Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
0ec1a141
Commit
0ec1a141
authored
Sep 23, 2016
by
Alexander Alashkin
Committed by
Cesanta Bot
Sep 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mg_http_parse_headers
PUBLISHED_FROM=7e88f60283d499732e8df663814067849d9567bb
parent
7414a4fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
mongoose.c
mongoose.c
+13
-2
No files found.
mongoose.c
View file @
0ec1a141
...
...
@@ -4045,8 +4045,8 @@ static int mg_http_get_request_len(const char *s, int buf_len) {
static
const
char
*
mg_http_parse_headers
(
const
char
*
s
,
const
char
*
end
,
int
len
,
struct
http_message
*
req
)
{
int
i
;
for
(
i
=
0
;
i
<
(
int
)
ARRAY_SIZE
(
req
->
header_names
)
-
1
;
i
++
)
{
int
i
=
0
;
while
(
i
<
(
int
)
ARRAY_SIZE
(
req
->
header_names
)
-
1
)
{
struct
mg_str
*
k
=
&
req
->
header_names
[
i
],
*
v
=
&
req
->
header_values
[
i
];
s
=
mg_skip
(
s
,
end
,
": "
,
k
);
...
...
@@ -4056,6 +4056,15 @@ static const char *mg_http_parse_headers(const char *s, const char *end,
v
->
len
--
;
/* Trim trailing spaces in header value */
}
/*
* If header value is empty - skip it and go to next (if any).
* NOTE: Do not add it to headers_values because such addition changes API
* behaviour
*/
if
(
k
->
len
!=
0
&&
v
->
len
==
0
)
{
continue
;
}
if
(
k
->
len
==
0
||
v
->
len
==
0
)
{
k
->
p
=
v
->
p
=
NULL
;
k
->
len
=
v
->
len
=
0
;
...
...
@@ -4066,6 +4075,8 @@ static const char *mg_http_parse_headers(const char *s, const char *end,
req
->
body
.
len
=
(
size_t
)
to64
(
v
->
p
);
req
->
message
.
len
=
len
+
req
->
body
.
len
;
}
i
++
;
}
return
s
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment