diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 7e46897a01d..162192da2b8 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -4363,9 +4363,6 @@ HttpSM::do_remap_request(bool run_inline) check_sni_host(); - // Preserve effective url before remap - t_state.unmapped_url.create(t_state.hdr_info.client_request.url_get()->m_heap); - t_state.unmapped_url.copy(t_state.hdr_info.client_request.url_get()); // Depending on a variety of factors the HOST field may or may not have been promoted to the // client request URL. The unmapped URL should always have that promotion done. If the HOST field // is not already there, promote it only in the unmapped_url. This avoids breaking any logic that diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index cdffac246c9..f379b16b5b6 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -958,6 +958,10 @@ HttpTransact::HandleBlindTunnel(State *s) void HttpTransact::StartRemapRequest(State *s) { + // Preserve effective url before remap, regardless of actual need for remap + s->unmapped_url.create(s->hdr_info.client_request.url_get()->m_heap); + s->unmapped_url.copy(s->hdr_info.client_request.url_get()); + if (s->api_skip_all_remapping) { TxnDebug("http_trans", "API request to skip remapping");