Only allow protocol "HTTP/1.1"
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 33s

This commit is contained in:
Stephen Seo 2024-09-06 15:57:46 +09:00
parent c194555527
commit c9c21105f6

View file

@ -146,6 +146,12 @@ char *c_simple_http_request_response(
*out_response_code = C_SIMPLE_HTTP_Response_400_Bad_Request;
}
return NULL;
} else if (strcmp(request_proto, "HTTP/1.1") != 0) {
fprintf(stderr, "ERROR Only HTTP/1.1 protocol requests are allowed!\n");
if (out_response_code) {
*out_response_code = C_SIMPLE_HTTP_Response_400_Bad_Request;
}
return NULL;
}
size_t generated_size = 0;