Add request (input) header for output handler#40
Add request (input) header for output handler#40jtfrey wants to merge 4 commits intonmaier:masterfrom
Conversation
|
lgtm in general. I am pondering right now if it would be better to have the header value state it is mod_xsendfile and what version (kind of a user-agent string) instead of just 1. That way the backend could detect it's mod_xsendfile (and a particular version to work around quirks) that is enabled. Anything I am missing? |
nmaier
left a comment
There was a problem hiding this comment.
If there is no objections regarding announcing mod_xsendfile and the version in the header value, I'd like to see you add that too.
| } | ||
|
|
||
| static int ap_xsendfile_add_request_header(request_rec *r) { | ||
| xsendfile_conf_active_t enabled = ((xsendfile_conf_t *)ap_get_module_config(r->per_dir_config, &xsendfile_module))->enabled; |
There was a problem hiding this comment.
This is duplicated code, add some function like ap_xsendfile_enabled_for(request_rec*) and use it in all places.
There was a problem hiding this comment.
Implemented ap_xsendfile_enabled_for_request()
| <li><code>X-SENDFILE-IS-ENABLED</code> - the filter is enabled for this request</li> | ||
| </ul> | ||
| </li> | ||
| <li>Returned by output handler: |
There was a problem hiding this comment.
This is a bit vague...
Something like "mod_xsendfile will process these response headers, if present"?
That seems like a good idea. Since the version doesn't appear in any other strings, I'm leaning toward: #define AP_XSENDFILE_IS_ENABLED_HEADER "X-SENDFILE-IS-ENABLED"
Correct. Working on your requested alterations right now, should have a commit pushed shortly. |
|
Sounds good re:version string... Or maybe make it |
…ke string, "mod_xsendfile/[version]" - Added function ap_xsendfile_enabled_for_request() to check for enablement per-request - Documentation altered accordingly
|
Requested changes pushed to my fork |
|
hey folks. it would be great to get this pull merged. folks relying on mod_xsendfile are starting to get push back because it's "no longer actively maintained". https://serverfault.com/questions/879130/is-mod-xsendfile-deprecated/ |
If mod_xsendfile is enabled on a request the X-SENDFILE-IS-ENABLED header is added to the request (input) headers so that the output handler knows X-Sendfile is supported on the request output.
Updated the docs accordingly.