mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-11-14 19:37:40 +00:00
send relative path in referer url
This commit is contained in:
1 parent
f879d4124b
commit
36c060fba3
1 file changed
+4
-1
@@ -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 */
|
||||
|
||||
Reference in new issue
Block a user