summaryrefslogtreecommitdiff
path: root/src/HttpRequest.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-04-25 17:44:03 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-04-25 17:44:03 +0000
commit2a81fd466d304d71dad16db93224db78525e08ce (patch)
treee58ba97937620342ae98b37901d74b6bad1574d4 /src/HttpRequest.h
parent8ea2f386cbe9de4aacf93316796b2957ae06f547 (diff)
2008-04-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added build-in "Accept-Feature" support. For now only "metalink" is used in this header field. This "metalink" value is removed from the list when connecting URLs fed by metalink file to avoid loop in "transparent" metlaink. * src/HttpRequest.cc * src/HttpRequest.h: Renamed _userHeaders as _headers. Accept-Feature header is also held in this variable. Also renamed setUserHeaders as addHeader and it was rewritten to add header not just to clear the old value. * src/HttpRequestCommand.cc * src/Metalink2RequestGroup.cc: Added the code to remove "metalink" from "Accept-Feature" list. * src/RequestGroup.cc: Added "metalink" to "Accept-Feature" by default. * src/RequestGroup.h * src/TaggedItem.cc: Moved Concat class to a2functional.h. * src/a2functional.h: Included <string> because Concat class depends on it. * test/HttpRequestTest.cc
Diffstat (limited to 'src/HttpRequest.h')
-rw-r--r--src/HttpRequest.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/HttpRequest.h b/src/HttpRequest.h
index ae39bb47..6a1cc124 100644
--- a/src/HttpRequest.h
+++ b/src/HttpRequest.h
@@ -66,7 +66,7 @@ private:
std::string userAgent;
- std::deque<std::string> _userHeaders;
+ std::deque<std::string> _headers;
std::string getHostText(const std::string& host, uint16_t port) const;
@@ -166,8 +166,9 @@ public:
{
this->userAgent = userAgent;
}
-
- void setUserHeaders(const std::string& userHeaders);
+
+ // accepts multiline headers, deliminated by LF
+ void addHeader(const std::string& headers);
};
typedef SharedHandle<HttpRequest> HttpRequestHandle;