NetServices: Remove Accept as standard and protected header.

In the old service kit, the Accept header was automatically set. However, it is
not a required header. This removes the default value and the protection against
setting it manually.

Required to make HaikuDepot work.

Change-Id: Ic589bfc5829db25915b67f2a13b6c2436c053e25
This commit is contained in:
Niels Sascha Reedijk
2022-07-20 06:28:17 +01:00
parent 2b4cd81ff3
commit b74e852fd9
3 changed files with 1 additions and 8 deletions
-1
View File
@@ -652,7 +652,6 @@ namespace Network {
There are a few reserved fields, which cannot be set as optional fields. These currently are:
* \c Host
* \c Accept
* \c Accept-Encoding
* \c Connection
* \c Content-Type
@@ -305,7 +305,6 @@ BHttpRequest::SetAuthentication(const BHttpAuthentication& authentication)
static constexpr std::array<std::string_view, 6> fReservedOptionalFieldNames = {
"Host"sv,
"Accept"sv,
"Accept-Encoding"sv,
"Connection"sv,
"Content-Type"sv,
@@ -477,7 +476,6 @@ BHttpRequest::SerializeHeaderTo(BDataIO* target) const
outputFields.AddFields({
{"Host"sv, std::string_view(host.String())},
{"Accept"sv, "*"sv},
{"Accept-Encoding"sv, "gzip"sv},
// Allows the server to compress data using the "gzip" format.
// "deflate" is not supported, because there are two interpretations
@@ -279,7 +279,6 @@ HttpProtocolTest::HttpMethodTest()
constexpr std::string_view kExpectedRequestText =
"GET / HTTP/1.1\r\n"
"Host: www.haiku-os.org\r\n"
"Accept: *\r\n"
"Accept-Encoding: gzip\r\n"
"Connection: close\r\n"
"Api-Key: 01234567890abcdef\r\n\r\n";
@@ -343,7 +342,6 @@ private:
constexpr std::string_view kExpectedStreamText =
"GET / HTTP/1.1\r\n"
"Host: www.haiku-os.org\r\n"
"Accept: *\r\n"
"Accept-Encoding: gzip\r\n"
"Connection: close\r\n\r\n";
@@ -542,7 +540,7 @@ static const BHttpFields kExpectedGetFields = {
{"Server"sv, "Test HTTP Server for Haiku"sv},
{"Date"sv, "Sun, 09 Feb 2020 19:32:42 GMT"sv},
{"Content-Type"sv, "text/plain"sv},
{"Content-Length"sv, "110"sv},
{"Content-Length"sv, "107"sv},
{"Content-Encoding"sv, "gzip"sv},
};
@@ -553,7 +551,6 @@ constexpr std::string_view kExpectedGetBody = {
"Headers:\r\n"
"--------\r\n"
"Host: 127.0.0.1:PORT\r\n"
"Accept: *\r\n"
"Accept-Encoding: gzip\r\n"
"Connection: close\r\n"
};
@@ -750,7 +747,6 @@ static BString kExpectedPostBody
"Headers:\r\n"
"--------\r\n"
"Host: 127.0.0.1:PORT\r\n"
"Accept: *\r\n"
"Accept-Encoding: gzip\r\n"
"Connection: close\r\n"
"Content-Type: text/plain\r\n"