mirror of https://github.com/calzoneman/sync.git
Fix redirect logic for ffprobe pre-flight check
This commit is contained in:
parent
842d0bb4be
commit
c809b1994a
|
@ -2,7 +2,7 @@
|
|||
"author": "Calvin Montgomery",
|
||||
"name": "CyTube",
|
||||
"description": "Online media synchronizer and chat",
|
||||
"version": "3.67.0",
|
||||
"version": "3.67.1",
|
||||
"repository": {
|
||||
"url": "http://github.com/calzoneman/sync"
|
||||
},
|
||||
|
|
|
@ -84,7 +84,9 @@ function initFFLog() {
|
|||
}
|
||||
|
||||
function fixRedirectIfNeeded(urldata, redirect) {
|
||||
if (!/^https:/.test(redirect)) {
|
||||
let parsedRedirect = urlparse.parse(redirect);
|
||||
if (parsedRedirect.host === null) {
|
||||
// Relative path, munge it to absolute
|
||||
redirect = urldata.protocol + "//" + urldata.host + redirect;
|
||||
}
|
||||
|
||||
|
@ -135,6 +137,13 @@ function testUrl(url, cb, params = { redirCount: 0, cookie: '' }) {
|
|||
const { redirCount, cookie } = params;
|
||||
var data = urlparse.parse(url);
|
||||
if (!/https:/.test(data.protocol)) {
|
||||
if (redirCount > 0) {
|
||||
// If the original URL redirected, the user is probably not aware
|
||||
// that the link they entered (which was HTTPS) is redirecting to a
|
||||
// non-HTTPS endpoint
|
||||
return cb(`Unexpected redirect to a non-HTTPS link: ${url}`);
|
||||
}
|
||||
|
||||
return cb("Only links starting with 'https://' are supported " +
|
||||
"for raw audio/video support");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue