diff --git a/History.md b/History.md index facdf5b7..689c08a9 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,9 @@ +# Unreleased Changes + +## 🚀 Improvements + +- Improve HTML structure in `res.redirect()` responses when HTML format is accepted by adding ``, `
' + statuses.message[status] + '. Redirecting to ' + u + '
' + body = '' + statuses.message[status] + '. Redirecting to ' + u + '
' }, default: function(){ diff --git a/test/res.redirect.js b/test/res.redirect.js index 264e0f2b..8d2b164e 100644 --- a/test/res.redirect.js +++ b/test/res.redirect.js @@ -91,7 +91,7 @@ describe('res', function(){ .set('Accept', 'text/html') .expect('Content-Type', /html/) .expect('Location', 'http://google.com') - .expect(302, 'Found. Redirecting to http://google.com
', done) + .expect(302, 'Found. Redirecting to http://google.com
', done) }) it('should escape the url', function(done){ @@ -107,7 +107,7 @@ describe('res', function(){ .set('Accept', 'text/html') .expect('Content-Type', /html/) .expect('Location', '%3Cla\'me%3E') - .expect(302, 'Found. Redirecting to %3Cla'me%3E
', done) + .expect(302, 'Found. Redirecting to %3Cla'me%3E
', done) }) it('should not render evil javascript links in anchor href (prevent XSS)', function(done){ @@ -125,7 +125,7 @@ describe('res', function(){ .set('Accept', 'text/html') .expect('Content-Type', /html/) .expect('Location', encodedXss) - .expect(302, 'Found. Redirecting to ' + encodedXss +'
', done); + .expect(302, 'Found. Redirecting to ' + encodedXss +'
', done); }); it('should include the redirect type', function(done){ @@ -140,7 +140,7 @@ describe('res', function(){ .set('Accept', 'text/html') .expect('Content-Type', /html/) .expect('Location', 'http://google.com') - .expect(301, 'Moved Permanently. Redirecting to http://google.com
', done); + .expect(301, 'Moved Permanently. Redirecting to http://google.com
', done); }) })