mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 18:22:59 +02:00
added better support for 'Expect: 100-continue' header and '100 Continue' responses
This commit is contained in:
@@ -43,6 +43,7 @@ const std::string HTTPRequest::COOKIE = "Cookie";
|
||||
const std::string HTTPRequest::AUTHORIZATION = "Authorization";
|
||||
const std::string HTTPRequest::PROXY_AUTHORIZATION = "Proxy-Authorization";
|
||||
const std::string HTTPRequest::UPGRADE = "Upgrade";
|
||||
const std::string HTTPRequest::EXPECT = "Expect";
|
||||
|
||||
|
||||
HTTPRequest::HTTPRequest():
|
||||
@@ -259,4 +260,20 @@ void HTTPRequest::setCredentials(const std::string& header, const std::string& s
|
||||
}
|
||||
|
||||
|
||||
bool HTTPRequest::getExpectContinue() const
|
||||
{
|
||||
const std::string& expect = get(EXPECT, EMPTY);
|
||||
return !expect.empty() && icompare(expect, "100-continue") == 0;
|
||||
}
|
||||
|
||||
|
||||
void HTTPRequest::setExpectContinue(bool expectContinue)
|
||||
{
|
||||
if (expectContinue)
|
||||
set(EXPECT, "100-continue");
|
||||
else
|
||||
erase(EXPECT);
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Net
|
||||
|
||||
Reference in New Issue
Block a user