diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-11-04 23:43:32 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-11-04 23:43:32 +0900 |
| commit | 601ec0f44adcbf97e7566b64fa9677f3b117ae6e (patch) | |
| tree | 7f099351f741ddd0895c5fa269d288debc939c06 /src/Request.cc | |
| parent | f84d2253b2250ed5760398c189bfc8bf8dff1f69 (diff) | |
Removed util::startsWith(a, b)
Diffstat (limited to 'src/Request.cc')
| -rw-r--r-- | src/Request.cc | 5 |
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 { |
