mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-21 22:56:19 +01:00
fixed GH #1260: URI encoding
This commit is contained in:
parent
af39c8d819
commit
c32e683b6c
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user