mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 03:20:11 +01:00
fixed GH #1260: URI encoding
This commit is contained in:
@@ -342,6 +342,7 @@ protected:
|
|||||||
|
|
||||||
static const std::string RESERVED_PATH;
|
static const std::string RESERVED_PATH;
|
||||||
static const std::string RESERVED_QUERY;
|
static const std::string RESERVED_QUERY;
|
||||||
|
static const std::string RESERVED_QUERY_PARAM;
|
||||||
static const std::string RESERVED_FRAGMENT;
|
static const std::string RESERVED_FRAGMENT;
|
||||||
static const std::string ILLEGAL;
|
static const std::string ILLEGAL;
|
||||||
|
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|
||||||
|
|
||||||
const std::string URI::RESERVED_PATH = "?#";
|
const std::string URI::RESERVED_PATH = "?#";
|
||||||
const std::string URI::RESERVED_QUERY = "?#/";
|
const std::string URI::RESERVED_QUERY = "?#/:;+@";
|
||||||
const std::string URI::RESERVED_FRAGMENT = "";
|
const std::string URI::RESERVED_QUERY_PARAM = "?#/:;+@&=";
|
||||||
const std::string URI::ILLEGAL = "%<>{}|\\\"^`";
|
const std::string URI::RESERVED_FRAGMENT = "";
|
||||||
|
const std::string URI::ILLEGAL = "%<>{}|\\\"^`!*'()$,[]";
|
||||||
|
|
||||||
|
|
||||||
URI::URI():
|
URI::URI():
|
||||||
@@ -333,12 +334,10 @@ void URI::setQuery(const std::string& query)
|
|||||||
|
|
||||||
void URI::addQueryParameter(const std::string& param, const std::string& val)
|
void URI::addQueryParameter(const std::string& param, const std::string& val)
|
||||||
{
|
{
|
||||||
std::string reserved(RESERVED_QUERY);
|
|
||||||
reserved += "=&";
|
|
||||||
if (!_query.empty()) _query += '&';
|
if (!_query.empty()) _query += '&';
|
||||||
encode(param, reserved, _query);
|
encode(param, RESERVED_QUERY_PARAM, _query);
|
||||||
_query += '=';
|
_query += '=';
|
||||||
encode(val, reserved, _query);
|
encode(val, RESERVED_QUERY_PARAM, _query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user