1
0
Fork 0

fixed download to accept srv://

This commit is contained in:
Frank Celler 2016-03-10 14:23:13 +01:00
parent 8d3c5c95c0
commit 576fb46b28
1 changed files with 13 additions and 0 deletions

View File

@ -776,6 +776,19 @@ static void JS_Download (const v8::FunctionCallbackInfo<v8::Value>& args) {
}
endpoint = "ssl://" + endpoint;
}
else if (url.substr(0, 6) == "srv://") {
size_t found = url.find('/', 6);
relative = "/";
if (found != string::npos) {
relative.append(url.substr(found + 1));
endpoint = url.substr(6, found - 6);
}
else {
endpoint = url.substr(6);
}
endpoint = "srv://" + endpoint;
}
else if (! url.empty() && url[0] == '/') {
// relative URL. prefix it with last endpoint
relative = url;