From 8eaab61ebece87e1103fb4d2884b0f4f6977c173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulises=20Gasc=C3=B3n?= Date: Tue, 10 Sep 2024 02:13:51 +0200 Subject: [PATCH] Merge commit from fork Co-authored-by: Chris de Almeida --- index.js | 3 +-- test/send.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 1e581b0..dcd1d07 100644 --- a/index.js +++ b/index.js @@ -381,8 +381,7 @@ SendStream.prototype.redirect = function redirect (path) { } var loc = encodeUrl(collapseLeadingSlashes(this.path + '/')) - var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + - escapeHtml(loc) + '') + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) // redirect res.statusCode = 301 diff --git a/test/send.js b/test/send.js index e399163..b824282 100644 --- a/test/send.js +++ b/test/send.js @@ -365,7 +365,7 @@ describe('send(file).pipe(res)', function () { .get('/pets') .expect('Location', '/pets/') .expect('Content-Type', /html/) - .expect(301, />Redirecting to \/pets\/<\/a>Redirecting to \/pets\/Redirecting to \/snow%20%E2%98%83\/<\/a>Redirecting to \/snow%20%E2%98%83\/