Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
eeab18ae
Commit
eeab18ae
authored
Dec 23, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https: discard leading and trailing OWS in header field values
parent
3d1ccaf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
modules/access/http/message.c
modules/access/http/message.c
+15
-1
No files found.
modules/access/http/message.c
View file @
eeab18ae
...
@@ -68,7 +68,8 @@ static int vlc_http_msg_vadd_header(struct vlc_http_msg *m, const char *name,
...
@@ -68,7 +68,8 @@ static int vlc_http_msg_vadd_header(struct vlc_http_msg *m, const char *name,
}
}
char
*
value
;
char
*
value
;
if
(
unlikely
(
vasprintf
(
&
value
,
fmt
,
ap
)
<
0
))
int
len
=
vasprintf
(
&
value
,
fmt
,
ap
);
if
(
unlikely
(
len
<
0
))
return
-
1
;
return
-
1
;
/* IETF RFC7230 §3.2.4 */
/* IETF RFC7230 §3.2.4 */
...
@@ -76,6 +77,19 @@ static int vlc_http_msg_vadd_header(struct vlc_http_msg *m, const char *name,
...
@@ -76,6 +77,19 @@ static int vlc_http_msg_vadd_header(struct vlc_http_msg *m, const char *name,
if
(
*
p
==
'\r'
||
*
p
==
'\n'
)
if
(
*
p
==
'\r'
||
*
p
==
'\n'
)
*
p
=
' '
;
*
p
=
' '
;
/* Discard leading OWS */
size_t
crop
=
strspn
(
value
,
"
\t
"
);
if
(
crop
>
0
)
{
assert
((
unsigned
)
len
>=
crop
);
memmove
(
value
,
value
+
crop
,
len
-
crop
+
1
);
len
-=
crop
;
}
/* Discard trailing OWS */
while
(
len
>
0
&&
(
value
[
len
-
1
]
==
'\t'
||
value
[
len
-
1
]
==
' '
))
value
[
--
len
]
=
'\0'
;
/* Fold identically named header field values. This is unfortunately not
/* Fold identically named header field values. This is unfortunately not
* possible for Set-Cookie, while Cookie requires a special separator. */
* possible for Set-Cookie, while Cookie requires a special separator. */
ssize_t
idx
=
vlc_http_msg_find_header
(
m
,
name
);
ssize_t
idx
=
vlc_http_msg_find_header
(
m
,
name
);
...
...
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