Skip to content

Commit 0c11fad

Browse files
UlisesGasconctcpip
andcommitted
Merge commit from fork
Co-authored-by: Chris de Almeida <ctcpip@users.noreply.github.com>
1 parent 9b5a12a commit 0c11fad

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ function createRedirectDirectoryListener () {
195195

196196
// reformat the URL
197197
var loc = encodeUrl(url.format(originalUrl))
198-
var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href="' + escapeHtml(loc) + '">' +
199-
escapeHtml(loc) + '</a>')
198+
var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc))
200199

201200
// send redirect response
202201
res.statusCode = 301

test/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ describe('serveStatic()', function () {
483483
request(server)
484484
.get('/users')
485485
.expect('Location', '/users/')
486-
.expect(301, /<a href="\/users\/">/, done)
486+
.expect(301, /\/users\//, done)
487487
})
488488

489489
it('should redirect directories with query string', function (done) {
@@ -505,7 +505,7 @@ describe('serveStatic()', function () {
505505
.get('/snow')
506506
.expect('Location', '/snow%20%E2%98%83/')
507507
.expect('Content-Type', /html/)
508-
.expect(301, />Redirecting to <a href="\/snow%20%E2%98%83\/">\/snow%20%E2%98%83\/<\/a></, done)
508+
.expect(301, />Redirecting to \/snow%20%E2%98%83\/</, done)
509509
})
510510

511511
it('should respond with default Content-Security-Policy', function (done) {

0 commit comments

Comments
 (0)