Skip to content
Myr

Added res.redirect() Content-Type of text/plain for now

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent be1541a · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • tests:+1 added−1 removed
  • other:+1 added−1 removed

2 files+2 added−2 removed

modified:lib/express/response.js+1 added-1 removed
265 unmodified lines
266 : map[url];267268 // Perform redirect269 url = mapped || url;270 this.writeHead(status || 302, { 'Location': url });270 this.writeHead(status || 302, { 'Content-Type': 'text/plain', 'Location': url });271 this.end('Redirecting to ' + url);272};
modified:test/response.test.js+1 added-1 removed
141 unmodified lines
142 { url: '/' },143 { body: 'Redirecting to http://google.com', status: 301, headers: { Location: 'http://google.com' }});144 assert.response(app,145 { url: '/back' },146 { body: 'Redirecting to /', status: 302, headers: { Location: '/' }});146 { body: 'Redirecting to /', status: 302, headers: { Location: '/', 'Content-Type': 'text/plain' }});147 assert.response(app,148 { url: '/back', headers: { Referer: '/foo' }},149 { body: 'Redirecting to /foo', status: 302, headers: { Location: '/foo' }});150 assert.response(app,
80 unmodified lines