summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_rewrite.c
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2024-04-10 14:00:39 +0800
committerZhidao HONG <z.hong@f5.com>2024-04-11 22:23:23 +0800
commita4dbee147cc13c9eef1f6cb209b4651a1419d17d (patch)
treed9bb5a43b2cfad03cbb29f06aeef5931834c7ee1 /src/nxt_http_rewrite.c
parent64934e59f9c06f62fe99466b320cd397c8609807 (diff)
downloadunit-a4dbee147cc13c9eef1f6cb209b4651a1419d17d.tar.gz
unit-a4dbee147cc13c9eef1f6cb209b4651a1419d17d.tar.bz2
HTTP: Rewrote url target section in nxt_h1p_peer_header_send()
Previously, proxy request was constructed based on the `r->target` field. However, r->target will remain unchanged in the future, even in cases of URL rewriting because of the requirement change for $request_uri that will be changed to constant. To accommodate this, the r->target should be designed to be constant, but Unit needs to pass a changeable URL to the upstream server. Based on the above, the proxy module can't depend on r->target.
Diffstat (limited to 'src/nxt_http_rewrite.c')
-rw-r--r--src/nxt_http_rewrite.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nxt_http_rewrite.c b/src/nxt_http_rewrite.c
index fb216eeb..ff465ecc 100644
--- a/src/nxt_http_rewrite.c
+++ b/src/nxt_http_rewrite.c
@@ -103,6 +103,9 @@ nxt_http_rewrite(nxt_task_t *task, nxt_http_request_t *r)
*r->path = rp.path;
+ r->uri_changed = 1;
+ r->quoted_target = rp.quoted_target;
+
if (nxt_slow_path(r->log_route)) {
nxt_log(task, NXT_LOG_NOTICE, "URI rewritten to \"%V\"", &r->target);
}