If mod_http2 detects too many or too large request headers in 
h2_stream_add_header or h2_stream_end_headers it does not create a
pseudo HTTP/1.1 request but directly responds back on the HTTP/2 stream. While 
this is very efficient from the HTTP/2 perspective
it has some bad drawbacks from my perspective:

1. The request is not logged in the access log.
2. Possible custom ErrorDocuments for this status code 
(HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE, 431) are ignored.

I would like to see this changed to have the drawbacks above addressed. 
Thoughts?

One approach I thought about is that set_error_response would set the 
http_status in a not yet existing field (e.g. early_status)
of the h2_request struct via stream->rtmp instead of creating a brigade in 
stream->out_buffer and adding to it.
h2_request_create_rec could then check for this field and if non zero call 
ap_die after doing some minimal request_rec setup.
I could hack something up for more detailed discussion if this approach seems 
acceptable.

BTW: Is the check for the field length in h2_stream_end_headers still needed as 
I think that h2_req_add_header called via
h2_request_add_header by h2_stream_add_header already takes care of it?

Regards

RĂ¼diger

Reply via email to