diff --git a/include/ts/experimental.h b/include/ts/experimental.h index d550d2d24c4..759d1768dc0 100644 --- a/include/ts/experimental.h +++ b/include/ts/experimental.h @@ -47,7 +47,8 @@ typedef enum { TS_FETCH_FLAGS_STREAM = 1 << 1, // enable stream IO TS_FETCH_FLAGS_DECHUNK = 1 << 2, // dechunk body content TS_FETCH_FLAGS_NEWLOCK = 1 << 3, // allocate new lock for fetch sm - TS_FETCH_FLAGS_NOT_INTERNAL_REQUEST = 1 << 4 // Allow this fetch to be created as a non-internal request. + TS_FETCH_FLAGS_NOT_INTERNAL_REQUEST = 1 << 4, // Allow this fetch to be created as a non-internal request. + TS_FETCH_FLAGS_SKIP_REMAP = 1 << 5, // Skip remapping and allow requesting arbitary URL } TSFetchFlags; /* Forward declaration of in_addr, any user of these APIs should probably diff --git a/iocore/net/I_NetVConnection.h b/iocore/net/I_NetVConnection.h index 09954cad441..441545304fe 100644 --- a/iocore/net/I_NetVConnection.h +++ b/iocore/net/I_NetVConnection.h @@ -419,6 +419,18 @@ class NetVConnection : public VConnection, public PluginUserArgs_fsm = FetchSMAllocator.alloc(); if (use_post) { - this->_fsm->ext_init(this, "POST", uri, "HTTP/1.1", reinterpret_cast(&sin), 0); + this->_fsm->ext_init(this, "POST", uri, "HTTP/1.1", reinterpret_cast(&sin), TS_FETCH_FLAGS_SKIP_REMAP); } else { - this->_fsm->ext_init(this, "GET", uri, "HTTP/1.1", reinterpret_cast(&sin), 0); + this->_fsm->ext_init(this, "GET", uri, "HTTP/1.1", reinterpret_cast(&sin), TS_FETCH_FLAGS_SKIP_REMAP); } } diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index ca05063aedb..a9c30dbaf60 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -409,6 +409,7 @@ HttpSM::attach_client_session(ProxyTransaction *client_vc) } t_state.setup_per_txn_configs(); + t_state.api_skip_all_remapping = netvc->get_is_unmanaged_request(); ink_assert(_ua.get_txn()->get_proxy_ssn()); ink_assert(_ua.get_txn()->get_proxy_ssn()->accept_options); diff --git a/src/traffic_server/FetchSM.cc b/src/traffic_server/FetchSM.cc index d5f7ea24df0..0fae526bdf5 100644 --- a/src/traffic_server/FetchSM.cc +++ b/src/traffic_server/FetchSM.cc @@ -92,6 +92,11 @@ FetchSM::httpConnect() } } + if (fetch_flags & TS_FETCH_FLAGS_SKIP_REMAP) { + PluginVC *other_side = reinterpret_cast(http_vc)->get_other_side(); + other_side->set_is_unmanaged_request(true); + } + read_vio = http_vc->do_io_read(this, INT64_MAX, resp_buffer); write_vio = http_vc->do_io_write(this, getReqLen() + req_content_length, req_reader); }