~samhh/bangin-server-node

b5391dd4db35c1aea6fe2e3f8967fd2f62f7b3bb — Sam A. Horvath-Hunt 3 months ago 417affe
Don't encodeURI bangin's output

Then it gets double-encoded in the browser (tested Chromium & vimb).
1 files changed, 1 insertions(+), 1 deletions(-)

M index.js
M index.js => index.js +1 -1
@@ 17,7 17,7 @@ http.createServer((req, res) => {
    cmd.stdout.on('data', x => { loc = String(x).trimEnd() })

    cmd.on('close', () => {
        res.writeHead(303, { 'Location': loc ? encodeURI(loc) : fallback(q) }).end()
        res.writeHead(303, { 'Location': loc ?? fallback(q) }).end()
    })
}).listen(port)