mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 04:17:55 +01:00
Net: near complete merge to 1.4.2
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPCookie.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTTPCookie.cpp#9 $
|
||||
// $Id: //poco/1.4/Net/src/HTTPCookie.cpp#1 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTP
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include "Poco/NumberParser.h"
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/URI.h"
|
||||
|
||||
|
||||
using Poco::Timestamp;
|
||||
@@ -315,4 +316,26 @@ std::string HTTPCookie::toString() const
|
||||
}
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
static const std::string ILLEGAL_CHARS("()[]/|\\',;");
|
||||
}
|
||||
|
||||
|
||||
std::string HTTPCookie::escape(const std::string& str)
|
||||
{
|
||||
std::string result;
|
||||
Poco::URI::encode(str, ILLEGAL_CHARS, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
std::string HTTPCookie::unescape(const std::string& str)
|
||||
{
|
||||
std::string result;
|
||||
Poco::URI::decode(str, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Net
|
||||
|
||||
Reference in New Issue
Block a user