-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add request (input) header for output handler #40
base: master
Are you sure you want to change the base?
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -292,8 +295,19 @@ static apr_status_t ap_xsendfile_get_filepath(request_rec *r, | |||
return rv; | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit vague...
Something like "mod_xsendfile will process these response headers, if present"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrote accordingly
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.