Skip to content
Myr

Fix res.redirect double-calling res.end for HEAD requests

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

fixes #2521

authored by Kevin Shay · committed by Douglas Christopher Wilson · parent 0b62f74 · Browse files · 2 files+3 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+3 added−2 removed

  • other:+3 added−2 removed

2 files+3 added−2 removed

modified:lib/response.js+2 added-2 removed
868 unmodified lines
869 this.set('Content-Length', Buffer.byteLength(body));870871 if (this.req.method === 'HEAD') {872 this.end();873 } else {874 this.end(body);875 }874875 this.end(body);876};877878/**879 * Add `field` to Vary. If already present in the Vary set, then
145 unmodified lines
modified:History.md+1 added
1unreleased2==========34 * Fix `res.redirect` double-calling `res.end` for `HEAD` requests5 * deps: type-is@~1.5.66 - deps: mime-types@~2.0.8784.11.1 / 2015-01-20
2619 unmodified lines