Use secure path.join
This commit is contained in:
parent
60b93be07e
commit
ed3caed0eb
1 changed files with 2 additions and 1 deletions
3
index.js
3
index.js
|
|
@ -7,6 +7,7 @@ const record_prefix = 'forward-domain=';
|
||||||
const {
|
const {
|
||||||
default: axios
|
default: axios
|
||||||
} = require('axios');
|
} = require('axios');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, {expire: number, expand: boolean, url: string}>}
|
* @type {Object<string, {expire: number, expand: boolean, url: string}>}
|
||||||
|
|
@ -46,7 +47,7 @@ const server = http.createServer(async function (req, res) {
|
||||||
resolveCache[req.headers.host] = cache;
|
resolveCache[req.headers.host] = cache;
|
||||||
}
|
}
|
||||||
res.writeHead(301, {
|
res.writeHead(301, {
|
||||||
'Location': cache.expand ? cache.url + req.url : cache.url,
|
'Location': cache.expand ? path.join(cache.url, req.url) : cache.url,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue