Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

"Clean up" redirected responses #241

Merged
merged 7 commits into from
Feb 7, 2017
Merged

Conversation

jeffposnick
Copy link
Contributor

R: @addyosmani @gauntface

This handles a new security restriction around redirected responses that is coming in Chrome 59, and is already implemented in Firefox. See https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1 for more details.

Fixes #220

lib/functions.js Outdated

return bodyPromise.then(function(body) {
// new Response() is happy when passed either a stream or a Blob.
return new Response(body, { // eslint-disable-line no-undef

Choose a reason for hiding this comment

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

Would adding /* eslint-env browser */ fix the need for this eslint-disable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added worker, since that's more accurate than browser. But yeah, it takes care of it.

test/test.js Outdated
});

it('should return the same response when redirected is false', function() {
var originalResponse = new Response(responseText); // eslint-disable-line no-undef

Choose a reason for hiding this comment

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

could you use new global.Response() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, switching.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants