mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
fixing h2c scheme/authority initialization
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1714557 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <httpd.h>
|
#include <httpd.h>
|
||||||
#include <http_core.h>
|
#include <http_core.h>
|
||||||
|
#include <http_protocol.h>
|
||||||
#include <http_config.h>
|
#include <http_config.h>
|
||||||
#include <http_log.h>
|
#include <http_log.h>
|
||||||
|
|
||||||
@@ -134,16 +135,22 @@ apr_status_t h2_request_rwrite(h2_request *req, request_rec *r)
|
|||||||
apr_status_t status;
|
apr_status_t status;
|
||||||
|
|
||||||
req->method = r->method;
|
req->method = r->method;
|
||||||
req->authority = r->hostname;
|
|
||||||
req->path = r->uri;
|
|
||||||
req->scheme = (r->parsed_uri.scheme? r->parsed_uri.scheme
|
req->scheme = (r->parsed_uri.scheme? r->parsed_uri.scheme
|
||||||
: r->server->server_scheme);
|
: ap_http_scheme(r));
|
||||||
|
req->authority = r->hostname;
|
||||||
|
req->path = apr_uri_unparse(r->pool, &r->parsed_uri,
|
||||||
|
APR_URI_UNP_OMITSITEPART);
|
||||||
|
|
||||||
if (!ap_strchr_c(req->authority, ':') && r->parsed_uri.port_str) {
|
if (!ap_strchr_c(req->authority, ':') && r->server) {
|
||||||
req->authority = apr_psprintf(r->pool, "%s:%s", req->authority,
|
req->authority = apr_psprintf(r->pool, "%s:%d", req->authority,
|
||||||
r->parsed_uri.port_str);
|
(int)r->server->port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AP_DEBUG_ASSERT(req->scheme);
|
||||||
|
AP_DEBUG_ASSERT(req->authority);
|
||||||
|
AP_DEBUG_ASSERT(req->path);
|
||||||
|
AP_DEBUG_ASSERT(req->method);
|
||||||
|
|
||||||
status = add_all_h1_header(req, r->pool, r->headers_in);
|
status = add_all_h1_header(req, r->pool, r->headers_in);
|
||||||
|
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r,
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r,
|
||||||
|
@@ -867,6 +867,10 @@ h2_ngheader *h2_util_ngheader_make_req(apr_pool_t *p,
|
|||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
AP_DEBUG_ASSERT(req);
|
AP_DEBUG_ASSERT(req);
|
||||||
|
AP_DEBUG_ASSERT(req->scheme);
|
||||||
|
AP_DEBUG_ASSERT(req->authority);
|
||||||
|
AP_DEBUG_ASSERT(req->path);
|
||||||
|
AP_DEBUG_ASSERT(req->method);
|
||||||
|
|
||||||
n = 4;
|
n = 4;
|
||||||
apr_table_do(count_header, &n, req->headers, NULL);
|
apr_table_do(count_header, &n, req->headers, NULL);
|
||||||
|
Reference in New Issue
Block a user