mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
add user content moved page
This commit is contained in:
parent
88c9baaf62
commit
8224fb8c66
14
node_modules/c9/urls.js
generated
vendored
14
node_modules/c9/urls.js
generated
vendored
@ -22,6 +22,14 @@ function main(options, imports, register) {
|
||||
});
|
||||
}
|
||||
|
||||
plugin.getHost = function(req) {
|
||||
return (req.headers && req.headers.host
|
||||
|| req.host
|
||||
|| req.url && req.url.replace(/^https?:\/\/([^/]*).*/, "$1")
|
||||
|| req
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a desired base URL, given some context.
|
||||
*
|
||||
@ -30,10 +38,8 @@ function main(options, imports, register) {
|
||||
* @param {String} targetBaseUrlPattern The target URL pattern, e.g. https://$DOMAIN
|
||||
*/
|
||||
plugin.getBaseUrl = function(req, sourceBaseUrlPattern, targetBaseUrlPattern) {
|
||||
var sourceHost = req.headers && req.headers.host
|
||||
|| req.host
|
||||
|| req.url && req.url.replace(/^https?:\/\/([^/]*).*/, "$1")
|
||||
|| req;
|
||||
var sourceHost = plugin.getHost(req);
|
||||
|
||||
if (typeof sourceHost !== "string")
|
||||
throw new Error("Not a valid request object: " + req);
|
||||
if (!sourceBaseUrlPattern)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user