mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-13 06:16:10 -04:00
ignore LWS after field-content in headers
This commit is contained in:
parent
c181399e92
commit
370a2c0213
15
http.c
15
http.c
@ -219,6 +219,20 @@ strsep(char **s, const char *del)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
rtrim(char *str)
|
||||||
|
{
|
||||||
|
char *cp;
|
||||||
|
|
||||||
|
if( str == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
cp = strchr(str, '\0') - 1;
|
||||||
|
|
||||||
|
while (cp >= str && *cp == ' ')
|
||||||
|
*cp-- = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
html_replace(const char ch, const char **escaped)
|
html_replace(const char ch, const char **escaped)
|
||||||
{
|
{
|
||||||
@ -1913,6 +1927,7 @@ evhttp_parse_headers_(struct evhttp_request *req, struct evbuffer* buffer)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
svalue += strspn(svalue, " ");
|
svalue += strspn(svalue, " ");
|
||||||
|
rtrim(svalue);
|
||||||
|
|
||||||
if (evhttp_add_header(headers, skey, svalue) == -1)
|
if (evhttp_add_header(headers, skey, svalue) == -1)
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user