mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
[http] keep query even if it was empty (closes #1844)
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
@@ -160,6 +160,7 @@ namespace http
|
|||||||
return true;
|
return true;
|
||||||
} else if (url.at(pos_c) == '?') {
|
} else if (url.at(pos_c) == '?') {
|
||||||
/* found query part */
|
/* found query part */
|
||||||
|
hasquery = true;
|
||||||
path = url.substr(pos_p, pos_c - pos_p);
|
path = url.substr(pos_p, pos_c - pos_p);
|
||||||
pos_p = pos_c + 1;
|
pos_p = pos_c + 1;
|
||||||
pos_c = url.find('#', pos_p);
|
pos_c = url.find('#', pos_p);
|
||||||
@@ -218,8 +219,10 @@ namespace http
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
out += path;
|
out += path;
|
||||||
|
if (hasquery) // add query even if it was empty
|
||||||
|
out += "?";
|
||||||
if (query != "")
|
if (query != "")
|
||||||
out += "?" + query;
|
out += query;
|
||||||
if (frag != "")
|
if (frag != "")
|
||||||
out += "#" + frag;
|
out += "#" + frag;
|
||||||
return out;
|
return out;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ namespace http
|
|||||||
std::string host;
|
std::string host;
|
||||||
unsigned short int port;
|
unsigned short int port;
|
||||||
std::string path;
|
std::string path;
|
||||||
|
bool hasquery;
|
||||||
std::string query;
|
std::string query;
|
||||||
std::string frag;
|
std::string frag;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user