summaryrefslogtreecommitdiff
path: root/src/Request.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-11-04 23:43:32 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-11-04 23:43:32 +0900
commit601ec0f44adcbf97e7566b64fa9677f3b117ae6e (patch)
tree7f099351f741ddd0895c5fa269d288debc939c06 /src/Request.cc
parentf84d2253b2250ed5760398c189bfc8bf8dff1f69 (diff)
Removed util::startsWith(a, b)
Diffstat (limited to 'src/Request.cc')
-rw-r--r--src/Request.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Request.cc b/src/Request.cc
index d611cb24..d6fa6c53 100644
--- a/src/Request.cc
+++ b/src/Request.cc
@@ -106,11 +106,14 @@ void Request::setReferer(const std::string& uri)
bool Request::redirectUri(const std::string& uri) {
supportsPersistentConnection_ = true;
++redirectCount_;
+ if(uri.empty()) {
+ return false;
+ }
std::string redirectedUri;
if(uri.find("://") == std::string::npos) {
// rfc2616 requires absolute URI should be provided by Location header
// field, but some servers don't obey this rule.
- if(util::startsWith(uri, "/")) {
+ if(uri[0] == '/') {
// abosulute path
redirectedUri = strconcat(protocol_, "://", host_, uri);
} else {