[mod_redirect,mod_rewrite] use server_name
use server_name for authority if Host not provided (Host is not required in HTTP/1.0)
This commit is contained in:
parent
b5cd216781
commit
f0df89a996
|
@ -163,6 +163,8 @@ URIHANDLER_FUNC(mod_redirect_uri_handler) {
|
|||
burl.port = sock_addr_get_port(&con->srv_socket->addr);
|
||||
burl.path = con->uri.path_raw;
|
||||
burl.query = con->uri.query;
|
||||
if (buffer_string_is_empty(burl.authority))
|
||||
burl.authority = con->server_name;
|
||||
|
||||
/* redirect URL on match
|
||||
* e.g. redirect /base/ to /index.php?section=base
|
||||
|
|
|
@ -256,6 +256,8 @@ static handler_t process_rewrite_rules(server *srv, connection *con, plugin_data
|
|||
burl.port = sock_addr_get_port(&con->srv_socket->addr);
|
||||
burl.path = con->uri.path_raw;
|
||||
burl.query = con->uri.query;
|
||||
if (buffer_string_is_empty(burl.authority))
|
||||
burl.authority = con->server_name;
|
||||
|
||||
rc = pcre_keyvalue_buffer_process(kvb, &ctx, con->request.uri, srv->tmp_buf);
|
||||
if (HANDLER_FINISHED == rc && !buffer_is_empty(srv->tmp_buf) && srv->tmp_buf->ptr[0] == '/') {
|
||||
|
|
Loading…
Reference in New Issue