Skip to content

Conversation

@aslushnikov
Copy link
Contributor

DevTools protocol doesn't support returning body of redirect responses.
We should explicitly throw in this case.

References #1896.

DevTools protocol doesn't support returning body of redirect responses.
We should explicitly throw in this case.

References puppeteer#1896.
const redirected = redirectChain[0].response();
expect(redirected.status()).toBe(302);
let error = null;
await redirected.text().catch(e => error = e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for next time let error = await redirected.text().catch(e => e)

expect(redirected.status()).toBe(302);
let error = null;
await redirected.text().catch(e => error = e);
expect(error).toBeTruthy();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.message

@aslushnikov aslushnikov merged commit f8cba45 into puppeteer:master Apr 11, 2018
@aslushnikov aslushnikov deleted the throw-on-redirect-response branch May 9, 2018 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants