diff options
author | Tim Retout <tim@retout.co.uk> | 2014-07-18 18:11:40 +0100 |
---|---|---|
committer | Tim Retout <tim@retout.co.uk> | 2014-07-18 19:06:54 +0100 |
commit | 163ffa7c4a7529ce257df72b1be392a0c0a32443 (patch) | |
tree | 6132e594184e6396cd2ca0058d585a0e8d0597ed /tor.cc | |
parent | 511fb0f0b5b0bf6c83c91a84633a22ae1c7cddf6 (diff) |
Allow URI schemes starting with "tor+", e.g. "tor+http://"
Diffstat (limited to 'tor.cc')
-rw-r--r-- | tor.cc | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -151,8 +151,16 @@ bool TorMethod::Fetch(FetchItem *Itm) URI Uri = Itm->Uri; string remotehost = Uri.Host; - // Undo the "tor" at the start - Uri.Access = "http"; + // Undo any "tor" or "tor+" at the start + string prefix="tor+"; + if ("tor" == Uri.Access) + { + Uri.Access = "http"; + } + else if (!Uri.Access.compare(0, prefix.size(), prefix)) + { + Uri.Access = Uri.Access.substr(prefix.size()); + } // TODO: // - http::Pipeline-Depth |