Don't assert that requests have a host header

This commit is contained in:
2025-12-18 10:37:28 +01:00
parent 02d8206e9d
commit 7f0c638b62
3 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -1434,7 +1434,8 @@ int chttp_get_param_i(CHTTP_String body, CHTTP_String str)
bool chttp_match_host(CHTTP_Request *req, CHTTP_String domain, int port)
{
int idx = chttp_find_header(req->headers, req->num_headers, CHTTP_STR("Host"));
assert(idx != -1); // Requests without the host header are always rejected
if (idx < 0)
return false;
char tmp[1<<8];
if (port > -1 && port != 80) {
+3 -2
View File
@@ -1,2 +1,3 @@
- Per RFC 6265, cookie values can be quoted. This parser would include the quotes in the value.
- Return an appropriate error code when the user waits on a client with no pending requests
[ ] Per RFC 6265, cookie values can be quoted. This parser would include the quotes in the value.
[ ] Return an appropriate error code when the user waits on a client with no pending requests
[ ] Add connection reuse limit
+2 -1
View File
@@ -1308,7 +1308,8 @@ int chttp_get_param_i(CHTTP_String body, CHTTP_String str)
bool chttp_match_host(CHTTP_Request *req, CHTTP_String domain, int port)
{
int idx = chttp_find_header(req->headers, req->num_headers, CHTTP_STR("Host"));
assert(idx != -1); // Requests without the host header are always rejected
if (idx < 0)
return false;
char tmp[1<<8];
if (port > -1 && port != 80) {