diff --git a/Foundation/include/Poco/URI.h b/Foundation/include/Poco/URI.h index 66309692b..ab4ff405c 100644 --- a/Foundation/include/Poco/URI.h +++ b/Foundation/include/Poco/URI.h @@ -342,6 +342,7 @@ protected: static const std::string RESERVED_PATH; static const std::string RESERVED_QUERY; + static const std::string RESERVED_QUERY_PARAM; static const std::string RESERVED_FRAGMENT; static const std::string ILLEGAL; diff --git a/Foundation/src/URI.cpp b/Foundation/src/URI.cpp index e0cbb241a..a6d0c0245 100644 --- a/Foundation/src/URI.cpp +++ b/Foundation/src/URI.cpp @@ -25,10 +25,11 @@ namespace Poco { -const std::string URI::RESERVED_PATH = "?#"; -const std::string URI::RESERVED_QUERY = "?#/"; -const std::string URI::RESERVED_FRAGMENT = ""; -const std::string URI::ILLEGAL = "%<>{}|\\\"^`"; +const std::string URI::RESERVED_PATH = "?#"; +const std::string URI::RESERVED_QUERY = "?#/:;+@"; +const std::string URI::RESERVED_QUERY_PARAM = "?#/:;+@&="; +const std::string URI::RESERVED_FRAGMENT = ""; +const std::string URI::ILLEGAL = "%<>{}|\\\"^`!*'()$,[]"; URI::URI(): @@ -333,12 +334,10 @@ void URI::setQuery(const std::string& query) void URI::addQueryParameter(const std::string& param, const std::string& val) { - std::string reserved(RESERVED_QUERY); - reserved += "=&"; if (!_query.empty()) _query += '&'; - encode(param, reserved, _query); + encode(param, RESERVED_QUERY_PARAM, _query); _query += '='; - encode(val, reserved, _query); + encode(val, RESERVED_QUERY_PARAM, _query); }