Skip to content

Commit

Permalink
fix(normalize): don’t set Content-Length: 0 Header for empty response
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Feb 24, 2018
1 parent aa5f062 commit 7e0326e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/normalize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ function normalize (scenarioState, fixture) {
fixture.headers = omitBy(fixture.headers, (value, key) => /^x-(now|zeit)-/.test(key))

// update content length
fixture.headers['content-length'] = String(calculateBodyLength(fixture.response))
if (/^application\/json/.test(fixture.headers['content-type'])) {
fixture.headers['content-length'] = String(calculateBodyLength(fixture.response))
}

// remove `Transfer-Encoding: chunked` headers:
// https://github.com/octokit/fixtures/issues/97octokit/fixtures#97
Expand Down

0 comments on commit 7e0326e

Please sign in to comment.