ASF Bugzilla – Attachment 32449 Details for
Bug 57563
Replace Host: header field when absolute request-target is used
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix for proxy_util.c, adding check for absolute URI
file_57563.txt (text/plain), 1.32 KB, created by
Tom Francis
on 2015-02-11 03:09:59 UTC
(
hide
)
Description:
Fix for proxy_util.c, adding check for absolute URI
Filename:
MIME Type:
Creator:
Tom Francis
Created:
2015-02-11 03:09:59 UTC
Size:
1.32 KB
patch
obsolete
>--- httpd-2.4.12/modules/proxy/proxy_util.c.orig 2015-01-14 08:28:00.000000000 -0500 >+++ httpd-2.4.12/modules/proxy/proxy_util.c 2015-02-10 18:43:53.000000000 -0500 >@@ -3311,10 +3311,24 @@ > } > } > else { >- /* don't want to use r->hostname, as the incoming header might have a >- * port attached >+ const char *hostname; >+ >+ /* According to RFC7230 section-5.4, if the absolute-form of request-target >+ * was given, set the Host: header sent to the orgin server to use the >+ * authority info from this, ignoring the provided Host: header > */ >- const char* hostname = apr_table_get(r->headers_in,"Host"); >+ if (r->parsed_uri.hostname){ >+ if (r->parsed_uri.port_str){ >+ hostname = apr_pstrcat(p, r->parsed_uri.hostname, ":", r->parsed_uri.port_str, NULL); >+ } else { >+ hostname = r->parsed_uri.hostname; >+ } >+ } else { >+ /* don't want to use r->hostname, as the incoming header might have a >+ * port attached >+ */ >+ hostname = apr_table_get(r->headers_in,"Host"); >+ } > if (!hostname) { > hostname = r->server->server_hostname; > ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01092)
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 57563
: 32449