Accept https:// and ftp:// in proxy options and environment variables.

pull/1/head
Tatsuhiro Tsujikawa 2011-02-07 22:59:04 +09:00
parent 954d595ee8
commit 3574f6bd7d
1 changed files with 5 additions and 2 deletions

View File

@ -628,10 +628,13 @@ void HttpProxyOptionHandler::parseArg(Option& option, const std::string& optarg)
} else {
Request req;
std::string uri;
if(util::startsWith(optarg, "http://")) {
if(util::startsWith(optarg, "http://") ||
util::startsWith(optarg, "https://") ||
util::startsWith(optarg, "ftp://")) {
uri = optarg;
} else {
uri = "http://"+optarg;
uri = "http://";
uri += optarg;
}
if(!req.setUri(uri)) {
throw DL_ABORT_EX(_("unrecognized proxy format"));