Lines 115-132
Link Here
|
115 |
/* |
115 |
/* |
116 |
* The http module shouldn't return anything other than |
116 |
* The http module shouldn't return anything other than |
117 |
* "http" (the default) or "https". |
117 |
* "http" (the default) or "https". |
|
|
118 |
* Bug 61355 - DirectorySlash directive should use protocol in X-Forwarded-Proto header when available |
118 |
*/ |
119 |
*/ |
|
|
120 |
char *scheme; |
119 |
if (r->server->server_scheme && |
121 |
if (r->server->server_scheme && |
120 |
(strcmp(r->server->server_scheme, "https") == 0)) |
122 |
(strcmp(r->server->server_scheme, "https") == 0)) |
121 |
return "https"; |
123 |
return "https"; |
|
|
124 |
if ((scheme = apr_table_get(r->headers_in, "X-Forwarded-Proto")) && |
125 |
(strcmp(scheme, "https") == 0)) |
126 |
return "https"; |
122 |
|
127 |
|
123 |
return "http"; |
128 |
return "http"; |
124 |
} |
129 |
} |
125 |
|
130 |
|
126 |
static apr_port_t http_port(const request_rec *r) |
131 |
static apr_port_t http_port(const request_rec *r) |
127 |
{ |
132 |
{ |
128 |
if (r->server->server_scheme && |
133 |
if (strcmp(http_scheme(r), "https") == 0) |
129 |
(strcmp(r->server->server_scheme, "https") == 0)) |
|
|
130 |
return DEFAULT_HTTPS_PORT; |
134 |
return DEFAULT_HTTPS_PORT; |
131 |
|
135 |
|
132 |
return DEFAULT_HTTP_PORT; |
136 |
return DEFAULT_HTTP_PORT; |