diff --git a/modules/http3/h3_request.c b/modules/http3/h3_request.c index babb3b51c75..4de9d701aef 100644 --- a/modules/http3/h3_request.c +++ b/modules/http3/h3_request.c @@ -293,6 +293,11 @@ static void* APR_THREAD_FUNC stream_worker(apr_thread_t* thd, void* data) /* CONNECT has no :path; its target is the authority, as in HTTP/1.1. */ ap_parse_uri(r, h3s->path ? h3s->path : h3s->authority ? h3s->authority : ""); r->the_request = apr_pstrcat(r->pool, r->method, " ", r->unparsed_uri, " ", r->protocol, NULL); + if (s->limit_req_line > 0 && strlen(r->the_request) > (apr_size_t)s->limit_req_line) + { + ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO() "request failed: client's request-line exceeds LimitRequestLine (longer than %d)", s->limit_req_line); + r->status = HTTP_REQUEST_URI_TOO_LARGE; + } if (h3s->authority) { apr_table_setn(r->headers_in, "Host", apr_pstrdup(r->pool, h3s->authority)); diff --git a/test/modules/http3/test_104_headers.py b/test/modules/http3/test_104_headers.py index 3bc49d5f29c..9686a88fa85 100644 --- a/test/modules/http3/test_104_headers.py +++ b/test/modules/http3/test_104_headers.py @@ -63,6 +63,4 @@ def test_h3_104_10_request_line(self, env): url = f"https://{env.h3_domain}:{env.https_port}{path}" assert env.curl_get(url, options=["--http1.1"]).response["status"] == 414 r = env.h3_client().get(path) - env.httpd_error_log.ignore_recent(lognos=["AH00036", "AH00127"]) - known_bug(r.status == 403, "LimitRequestLine does not apply") - assert r.status == 414 or r.reset is not None, f"{r}" + assert r.status == 414, f"{r}"