Add support for X-WWW-Authenticate header

This commit is contained in:
2021-11-21 19:57:18 +01:00
parent 6aa70c0ea3
commit 9eb9f5aa34

View File

@@ -274,7 +274,8 @@ static int http_on_header_value(http_parser *parser, const char *at, size_t leng
} else if (strcasecmp(client->current_header_key, "Transfer-Encoding") == 0
&& memcmp(at, "chunked", length) == 0) {
client->response->is_chunked = true;
} else if (strcasecmp(client->current_header_key, "WWW-Authenticate") == 0) {
} else if (strcasecmp(client->current_header_key, "WWW-Authenticate") == 0 ||
strcasecmp(client->current_header_key, "X-WWW-Authenticate") == 0) {
HTTP_RET_ON_FALSE_DBG(http_utils_append_string(&client->auth_header, at, length), -1, TAG, "Failed to append string");
}
HTTP_RET_ON_FALSE_DBG(http_utils_append_string(&client->current_header_value, at, length), -1, TAG, "Failed to append string");