Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Network): explicitly throw on content request for redirect response #2352

Merged
merged 2 commits into from Apr 11, 2018

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
Collaborator

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
Collaborator

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.

None yet

2 participants