Skip to content

Commit

Permalink
fix(normalize): get redirect URL from location header
Browse files Browse the repository at this point in the history
response.url is not awlays set
  • Loading branch information
gr2m committed Feb 24, 2018
1 parent 7e0326e commit 01640ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/normalize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ function normalize (scenarioState, fixture) {

// handle redirect response
if (fixture.status > 300 && fixture.status < 400) {
fixture.response.url = fixturizePath(scenarioState, fixture.response.url)
fixture.headers.location = fixturizePath(scenarioState, fixture.headers.location)
if (fixture.response.url) {
fixture.response.url = fixture.headers.location
}
}

return fixture
Expand Down

0 comments on commit 01640ac

Please sign in to comment.