Commit c28afe54 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Change the response code on overly long request lines from 400 to 413

as per discussions in httpbis WG
parent c426c9bd
...@@ -522,7 +522,7 @@ http_dissect_hdrs(struct worker *w, struct http *hp, int fd, char *p, ...@@ -522,7 +522,7 @@ http_dissect_hdrs(struct worker *w, struct http *hp, int fd, char *p,
if (q - p > htc->maxhdr) { if (q - p > htc->maxhdr) {
VSC_C_main->losthdr++; VSC_C_main->losthdr++;
WSL(w, SLT_LostHeader, fd, "%.*s", q - p, p); WSL(w, SLT_LostHeader, fd, "%.*s", q - p, p);
return (400); return (413);
} }
/* Empty header = end of headers */ /* Empty header = end of headers */
...@@ -547,7 +547,7 @@ http_dissect_hdrs(struct worker *w, struct http *hp, int fd, char *p, ...@@ -547,7 +547,7 @@ http_dissect_hdrs(struct worker *w, struct http *hp, int fd, char *p,
} else { } else {
VSC_C_main->losthdr++; VSC_C_main->losthdr++;
WSL(w, SLT_LostHeader, fd, "%.*s", q - p, p); WSL(w, SLT_LostHeader, fd, "%.*s", q - p, p);
return (400); return (413);
} }
} }
return (0); return (0);
...@@ -598,7 +598,7 @@ http_splitline(struct worker *w, int fd, struct http *hp, ...@@ -598,7 +598,7 @@ http_splitline(struct worker *w, int fd, struct http *hp,
hp->hd[h2].e = p; hp->hd[h2].e = p;
if (!Tlen(hp->hd[h2])) if (!Tlen(hp->hd[h2]))
return (400); return (413);
/* Skip SP */ /* Skip SP */
for (; vct_issp(*p); p++) { for (; vct_issp(*p); p++) {
......
...@@ -23,7 +23,7 @@ client c1 { ...@@ -23,7 +23,7 @@ client c1 {
expect resp.status == 200 expect resp.status == 200
txreq -url "/1" -hdr "1...5....0....5....0....5....0....5....0." txreq -url "/1" -hdr "1...5....0....5....0....5....0....5....0."
rxresp rxresp
expect resp.status == 400 expect resp.status == 413
} -run } -run
client c1 { client c1 {
...@@ -32,7 +32,7 @@ client c1 { ...@@ -32,7 +32,7 @@ client c1 {
expect resp.status == 200 expect resp.status == 200
txreq -url "/2" -hdr "1...5....0....5\n ..0....5....0....5....0." txreq -url "/2" -hdr "1...5....0....5\n ..0....5....0....5....0."
rxresp rxresp
expect resp.status == 400 expect resp.status == 413
} -run } -run
client c1 { client c1 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment