http-headers/Connection: fix connection header parsing

This commit is contained in:
Minglei Jin 2021-02-20 14:55:31 +08:00
parent e9840fe3c8
commit 1857355a2c
1 changed files with 1 additions and 1 deletions

View File

@ -229,7 +229,7 @@ static int32_t httpOnParseHeaderField(HttpParser *parser, const char *key, const
return 0; return 0;
} }
else if (strncasecmp(key, "Connection: ", 12) == 0) { else if (strncasecmp(key, "Connection", 10) == 0) {
if (strncasecmp(val, "Keep-Alive", 10) == 0) { if (strncasecmp(val, "Keep-Alive", 10) == 0) {
parser->keepAlive = HTTP_KEEPALIVE_ENABLE; parser->keepAlive = HTTP_KEEPALIVE_ENABLE;
} else { } else {