From 36c060fba39546534986d61999d8d4e225f6247f Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 26 Oct 2026 17:09:09 -0400 Subject: [PATCH] send relative path in referer url --- libi2pd_client/HTTPProxy.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libi2pd_client/HTTPProxy.cpp b/libi2pd_client/HTTPProxy.cpp index af495b39..566bca78 100644 --- a/libi2pd_client/HTTPProxy.cpp +++ b/libi2pd_client/HTTPProxy.cpp @@ -349,11 +349,14 @@ namespace proxy * leave Referer if requested URL with same schema, host and port, * otherwise, drop it. */ - if(req.GetHeader("Referer") != "") { + if (!req.GetHeader("Referer").empty ()) + { i2p::http::URL reqURL; reqURL.parse(req.uri); i2p::http::URL refURL; refURL.parse(req.GetHeader("Referer")); if(!boost::iequals(reqURL.schema, refURL.schema) || !boost::iequals(reqURL.host, refURL.host) || reqURL.port != refURL.port) req.RemoveHeader("Referer"); + else + req.UpdateHeader("Referer", refURL.to_string (true)); } /* add headers */