Skip to content

Commit

Permalink
Merge commit from fork
Browse files Browse the repository at this point in the history
Co-authored-by: Chris de Almeida <[email protected]>
  • Loading branch information
UlisesGascon and ctcpip committed Sep 10, 2024
1 parent 9774100 commit 8eaab61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@ SendStream.prototype.redirect = function redirect (path) {
}

var loc = encodeUrl(collapseLeadingSlashes(this.path + '/'))
var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href="' + escapeHtml(loc) + '">' +
escapeHtml(loc) + '</a>')
var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc))

// redirect
res.statusCode = 301
Expand Down
4 changes: 2 additions & 2 deletions test/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ describe('send(file).pipe(res)', function () {
.get('/pets')
.expect('Location', '/pets/')
.expect('Content-Type', /html/)
.expect(301, />Redirecting to <a href="\/pets\/">\/pets\/<\/a></, done)
.expect(301, />Redirecting to \/pets\/</, done)
})

it('should respond with default Content-Security-Policy', function (done) {
Expand Down Expand Up @@ -393,7 +393,7 @@ describe('send(file).pipe(res)', function () {
.get('/snow')
.expect('Location', '/snow%20%E2%98%83/')
.expect('Content-Type', /html/)
.expect(301, />Redirecting to <a href="\/snow%20%E2%98%83\/">\/snow%20%E2%98%83\/<\/a></, done)
.expect(301, />Redirecting to \/snow%20%E2%98%83\/</, done)
})
})

Expand Down

0 comments on commit 8eaab61

Please sign in to comment.