--- modules/http/http_core.c Wed Sep 19 14:54:51 2018 +++ modules/http/http_core.c Wed Dec 5 19:56:20 2018 @@ -115,18 +115,22 @@ /* * The http module shouldn't return anything other than * "http" (the default) or "https". + * Bug 61355 - DirectorySlash directive should use protocol in X-Forwarded-Proto header when available */ + char *scheme; if (r->server->server_scheme && (strcmp(r->server->server_scheme, "https") == 0)) return "https"; + if ((scheme = apr_table_get(r->headers_in, "X-Forwarded-Proto")) && + (strcmp(scheme, "https") == 0)) + return "https"; return "http"; } static apr_port_t http_port(const request_rec *r) { - if (r->server->server_scheme && - (strcmp(r->server->server_scheme, "https") == 0)) + if (strcmp(http_scheme(r), "https") == 0) return DEFAULT_HTTPS_PORT; return DEFAULT_HTTP_PORT;