Skip to content

Commit

Permalink
fix(webkit): allow fufilling requests to redirects (#1830)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelEinbinder committed Apr 16, 2020
1 parent 5ec2c58 commit 036f9e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/webkit/wkInterceptableRequest.ts
Expand Up @@ -69,7 +69,7 @@ export class WKInterceptableRequest implements network.RouteDelegate {
await this._interceptedPromise;

const base64Encoded = !!response.body && !helper.isString(response.body);
const responseBody = response.body ? (base64Encoded ? response.body.toString('base64') : response.body as string) : undefined;
const responseBody = response.body ? (base64Encoded ? response.body.toString('base64') : response.body as string) : '';

const responseHeaders: { [s: string]: string; } = {};
if (response.headers) {
Expand Down
3 changes: 1 addition & 2 deletions test/interception.spec.js
Expand Up @@ -368,8 +368,7 @@ describe('Page.route', function() {
expect(response.ok()).toBe(true);
expect(intercepted).toBe(true);
});
// WebKit crashes. Firefox succeeds, but then fails to close.
it.fail(FFOX || WEBKIT)('should create a redirect', async({page, server}) => {
it('should create a redirect', async({page, server}) => {
await page.goto(server.PREFIX + '/empty.html');
await page.route('**/*', async(route, request) => {
if (request.url() !== server.PREFIX + '/redirect_this')
Expand Down

0 comments on commit 036f9e5

Please sign in to comment.