FreeBSD Bugzilla – Attachment 162806 Details for
Bug 204304
www/apache24: Include REDIRECT_URL fix from 2.4.next
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch extracted from svn
patch-redirect_url (text/plain), 4.26 KB, created by
fullermd
on 2015-11-05 10:16:44 UTC
(
hide
)
Description:
Patch extracted from svn
Filename:
MIME Type:
Creator:
fullermd
Created:
2015-11-05 10:16:44 UTC
Size:
4.26 KB
patch
obsolete
>Index: include/http_core.h >=================================================================== >--- include/http_core.h (revision 1712267) >+++ include/http_core.h (revision 1712268) >@@ -465,6 +465,17 @@ > /* This is the default value used */ > #define ETAG_BACKWARD (ETAG_MTIME | ETAG_SIZE) > >+/* Generic ON/OFF/UNSET for unsigned int foo :2 */ >+#define AP_CORE_CONFIG_OFF (0) >+#define AP_CORE_CONFIG_ON (1) >+#define AP_CORE_CONFIG_UNSET (2) >+ >+/* Generic merge of flag */ >+#define AP_CORE_MERGE_FLAG(field, to, base, over) to->field = \ >+ over->field != AP_CORE_CONFIG_UNSET \ >+ ? over->field \ >+ : base->field >+ > /** > * @brief Server Signature Enumeration > */ >@@ -630,6 +641,8 @@ > * advice > */ > unsigned int cgi_pass_auth : 2; >+ unsigned int qualify_redirect_url :2; >+ > } core_dir_config; > > /* macro to implement off by default behaviour */ >Index: server/core.c >=================================================================== >--- server/core.c (revision 1712267) >+++ server/core.c (revision 1712268) >@@ -191,6 +191,7 @@ > conf->max_reversals = AP_MAXRANGES_UNSET; > > conf->cgi_pass_auth = AP_CGI_PASS_AUTH_UNSET; >+ conf->qualify_redirect_url = AP_CORE_CONFIG_UNSET; > > return (void *)conf; > } >@@ -405,6 +406,8 @@ > > conf->cgi_pass_auth = new->cgi_pass_auth != AP_CGI_PASS_AUTH_UNSET ? new->cgi_pass_auth : base->cgi_pass_auth; > >+ AP_CORE_MERGE_FLAG(qualify_redirect_url, conf, base, new); >+ > return (void*)conf; > } > >@@ -1707,6 +1710,15 @@ > return NULL; > } > >+static const char *set_qualify_redirect_url(cmd_parms *cmd, void *d_, int flag) >+{ >+ core_dir_config *d = d_; >+ >+ d->qualify_redirect_url = flag ? AP_CORE_CONFIG_ON : AP_CORE_CONFIG_OFF; >+ >+ return NULL; >+} >+ > static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *const argv[]) > { > core_dir_config *d = d_; >@@ -4206,6 +4218,10 @@ > AP_INIT_FLAG("CGIPassAuth", set_cgi_pass_auth, NULL, OR_AUTHCFG, > "Controls whether HTTP authorization headers, normally hidden, will " > "be passed to scripts"), >+AP_INIT_FLAG("QualifyRedirectURL", set_qualify_redirect_url, NULL, OR_FILEINFO, >+ "Controls whether HTTP authorization headers, normally hidden, will " >+ "be passed to scripts"), >+ > AP_INIT_TAKE1("ForceType", ap_set_string_slot_lower, > (void *)APR_OFFSETOF(core_dir_config, mime_type), OR_FILEINFO, > "a mime type that overrides other configured type"), >Index: server/util_script.c >=================================================================== >--- server/util_script.c (revision 1712267) >+++ server/util_script.c (revision 1712268) >@@ -282,21 +282,26 @@ > /* Apache custom error responses. If we have redirected set two new vars */ > > if (r->prev) { >- /* PR#57785: reconstruct full URL here */ >- apr_uri_t *uri = &r->prev->parsed_uri; >- if (!uri->scheme) { >- uri->scheme = (char*)ap_http_scheme(r->prev); >+ if (conf->qualify_redirect_url != AP_CORE_CONFIG_ON) { >+ add_unless_null(e, "REDIRECT_URL", r->prev->uri); > } >- if (!uri->port) { >- uri->port = ap_get_server_port(r->prev); >- uri->port_str = apr_psprintf(r->pool, "%u", uri->port); >+ else { >+ /* PR#57785: reconstruct full URL here */ >+ apr_uri_t *uri = &r->prev->parsed_uri; >+ if (!uri->scheme) { >+ uri->scheme = (char*)ap_http_scheme(r->prev); >+ } >+ if (!uri->port) { >+ uri->port = ap_get_server_port(r->prev); >+ uri->port_str = apr_psprintf(r->pool, "%u", uri->port); >+ } >+ if (!uri->hostname) { >+ uri->hostname = (char*)ap_get_server_name_for_url(r->prev); >+ } >+ add_unless_null(e, "REDIRECT_URL", >+ apr_uri_unparse(r->pool, uri, 0)); > } >- if (!uri->hostname) { >- uri->hostname = (char*)ap_get_server_name_for_url(r->prev); >- } > add_unless_null(e, "REDIRECT_QUERY_STRING", r->prev->args); >- add_unless_null(e, "REDIRECT_URL", >- apr_uri_unparse(r->pool, uri, 0)); > } > > if (e != r->subprocess_env) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204304
: 162806