Commit 92db6820 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Close API request connection for 400 and 413 response

parent 851cbd49
...@@ -71,6 +71,15 @@ int APIDownstreamConnection::send_reply(unsigned int http_status, ...@@ -71,6 +71,15 @@ int APIDownstreamConnection::send_reply(unsigned int http_status,
resp.fs.add_header_token(StringRef::from_lit("content-length"), resp.fs.add_header_token(StringRef::from_lit("content-length"),
content_length, false, http2::HD_CONTENT_LENGTH); content_length, false, http2::HD_CONTENT_LENGTH);
switch (http_status) {
case 400:
case 413:
resp.fs.add_header_token(StringRef::from_lit("connection"),
StringRef::from_lit("close"), false,
http2::HD_CONNECTION);
break;
}
if (upstream->send_reply(downstream_, body.byte(), body.size()) != 0) { if (upstream->send_reply(downstream_, body.byte(), body.size()) != 0) {
return -1; return -1;
} }
......
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