summaryrefslogtreecommitdiff
path: root/src/HttpRequestCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-05-11 13:14:41 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-05-11 13:14:41 +0000
commit4e3c08d50cda892a5d3ce32a9559805527f9a793 (patch)
tree87c13645913d399b46de9346bb3aad16bb40d92d /src/HttpRequestCommand.cc
parent1f931b33bdf3f182a48f876d26d4783f02221ce9 (diff)
2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten Accept-Features handling. * src/HttpRequestCommand.cc (createHttpRequest)
Diffstat (limited to 'src/HttpRequestCommand.cc')
-rw-r--r--src/HttpRequestCommand.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc
index 803f876c..0eef8246 100644
--- a/src/HttpRequestCommand.cc
+++ b/src/HttpRequestCommand.cc
@@ -79,14 +79,15 @@ createHttpRequest(const SharedHandle<Request>& req,
httpRequest->setSegment(segment);
httpRequest->setEntityLength(totalLength);
httpRequest->addHeader(option->get(PREF_HEADER));
- if(rg->getAcceptFeatures().size()) {
+ if(!rg->getAcceptFeatures().empty()) {
const std::deque<std::string>& acceptFeatures = rg->getAcceptFeatures();
- std::string acceptFeaturesHeader = "Accept-Features: "+
- Util::trim
- (std::accumulate(acceptFeatures.begin()+1, acceptFeatures.end(),
- *acceptFeatures.begin(),
- Concat(",")),
- ",");
+
+ std::string acceptFeaturesHeader = "Accept-Features: "+*acceptFeatures.begin();
+ for(std::deque<std::string>::const_iterator i = acceptFeatures.begin()+1;
+ i != acceptFeatures.end(); ++i) {
+ acceptFeaturesHeader += ","+(*i);
+ }
+
httpRequest->addHeader(acceptFeaturesHeader);
}
httpRequest->addAcceptType(rg->getAcceptTypes().begin(),