Express handling URIError: Failed to decode param
问题 var express = require('express'); var app = express(); app.get('*', function (req, res) { var host = req.get('Host'); return res.redirect(['https://', host, req.url].join('')); }); var server = app.listen(8080, function () { console.log('starting'); }); I have a simple script that redirects http to https. This is working fine except when there is a malformed url for example: website.com/%c0%ae%c0%ae. It displays something like: URIError: Failed to decode param '/%c0%ae%c0%ae' at