Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WebServer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
codecraft
WebServer
Commits
206fa32e
Commit
206fa32e
authored
2 years ago
by
codecraft
Browse files
Options
Downloads
Patches
Plain Diff
finishing the `get_post_data()` function for binary
Applicacation-x-www-urlencoded forms
parent
d13f4659
Branches
Branches containing commit
No related tags found
1 merge request
!1
Initial feature merge
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/http/src/handling/request.rs
+5
-2
5 additions, 2 deletions
core/http/src/handling/request.rs
with
5 additions
and
2 deletions
core/http/src/handling/request.rs
+
5
−
2
View file @
206fa32e
...
@@ -145,7 +145,10 @@ impl Request<'_> {
...
@@ -145,7 +145,10 @@ impl Request<'_> {
match
post_type
{
match
post_type
{
Mime
::
ApplicationXWwwFormUrlencoded
=>
{
Mime
::
ApplicationXWwwFormUrlencoded
=>
{
for
kvp
in
data
.split
(|
byte
|
*
byte
==
b'&'
)
{
for
kvp
in
data
.split
(|
byte
|
*
byte
==
b'&'
)
{
let
kvp
=
kvp
.split
(|
byte
|
*
byte
==
b'='
)
.collect
::
<
Vec
<&
[
u8
]
>>
();
let
kvp
=
kvp
.split
(|
byte
|
*
byte
==
b'='
)
.map
(|
list
|
list
.to_vec
())
.collect
::
<
Vec
<
Vec
<
u8
>>>
();
let
key
=
if
let
Some
(
kv
)
=
kvp
.get
(
0
)
{
let
key
=
if
let
Some
(
kv
)
=
kvp
.get
(
0
)
{
kv
kv
}
else
{
}
else
{
...
@@ -331,7 +334,7 @@ mod test {
...
@@ -331,7 +334,7 @@ mod test {
method
:
crate
::
handling
::
methods
::
Method
::
Post
,
method
:
crate
::
handling
::
methods
::
Method
::
Post
,
};
};
let
data
=
Data
{
let
data
=
Data
{
buffer
:
b"message=2
3
&message1=2
4
"
.to_vec
(),
buffer
:
b"message=2
4
&message1=2
3
"
.to_vec
(),
is_complete
:
true
,
is_complete
:
true
,
};
};
assert_eq!
(
assert_eq!
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment