Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: 1.16.0 #173

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.16.0 / 2024-09-10
===================

* Remove link renderization in html while redirecting


1.15.0 / 2022-03-24
===================

Expand Down
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ function createRedirectDirectoryListener () {

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

// send redirect response
res.statusCode = 301
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "serve-static",
"description": "Serve static files",
"version": "1.15.0",
"version": "1.16.0",
"author": "Douglas Christopher Wilson <[email protected]>",
"license": "MIT",
"repository": "expressjs/serve-static",
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ describe('serveStatic()', function () {
request(server)
.get('/users')
.expect('Location', '/users/')
.expect(301, /<a href="\/users\/">/, done)
.expect(301, /\/users\//, done)
})

it('should redirect directories with query string', function (done) {
Expand All @@ -505,7 +505,7 @@ describe('serveStatic()', 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)
})

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