From 4e3c08d50cda892a5d3ce32a9559805527f9a793 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 11 May 2008 13:14:41 +0000 Subject: [PATCH] 2008-05-11 Tatsuhiro Tsujikawa Rewritten Accept-Features handling. * src/HttpRequestCommand.cc (createHttpRequest) --- ChangeLog | 5 +++++ src/HttpRequestCommand.cc | 15 ++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f01cab91..f6cf317a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-11 Tatsuhiro Tsujikawa + + Rewritten Accept-Features handling. + * src/HttpRequestCommand.cc (createHttpRequest) + 2008-05-11 Tatsuhiro Tsujikawa Rewritten accept types handling. 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& req, httpRequest->setSegment(segment); httpRequest->setEntityLength(totalLength); httpRequest->addHeader(option->get(PREF_HEADER)); - if(rg->getAcceptFeatures().size()) { + if(!rg->getAcceptFeatures().empty()) { const std::deque& 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::const_iterator i = acceptFeatures.begin()+1; + i != acceptFeatures.end(); ++i) { + acceptFeaturesHeader += ","+(*i); + } + httpRequest->addHeader(acceptFeaturesHeader); } httpRequest->addAcceptType(rg->getAcceptTypes().begin(),