Supporting HTTP/1.0 keep-alive.
The Apache HTTP server benchmarking tool, ab, issues HTTP/1.0 requests with
the 'Connection: Keep-Alive' header and expects a 'Connection: Keep-Alive'
header in the response.
@@ -734,9 +734,16 @@ nxt_h1p_connection(void *ctx, nxt_http_field_t *field, uintptr_t data)
r = ctx;
field->hopbyhop = 1;
- if (field->value_length == 5 && nxt_memcmp(field->value, "close", 5) == 0) {
+ if (field->value_length == 5
+ && nxt_memcasecmp(field->value, "close", 5) == 0)
+ {
r->proto.h1->keepalive = 0;
+ } else if (field->value_length == 10
+ && nxt_memcasecmp(field->value, "keep-alive", 10) == 0)
+ {
+ r->proto.h1->keepalive = 1;
+
} else if (field->value_length == 7
&& nxt_memcasecmp(field->value, "upgrade", 7) == 0)
{
