-
Notifications
You must be signed in to change notification settings - Fork 801
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
Use an empty object rather than undefined when calling new Headers() #1463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with just a few suggestions/questions.
@@ -29,7 +29,8 @@ import '../_version.mjs'; | |||
* @memberof workbox.streams | |||
*/ | |||
function createHeaders(headersInit) { | |||
const headers = new Headers(headersInit); | |||
// See https://github.com/GoogleChrome/workbox/issues/1461 | |||
const headers = new Headers(headersInit || {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optionally, headersInit
could default to {}
in the function declaration.
|
||
import {createHeaders} from '../../../../packages/workbox-streams/utils/createHeaders.mjs'; | ||
|
||
describe(`[workbox-streams] utils/createHeaders`, function() { | ||
const sandbox = sinon.sandbox.create(); | ||
|
||
afterEach(async function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be async?
PR-Bot Size PluginChanged File SizesNo file sizes have changed. New Files
All File SizesView Table
Workbox Aggregate Size Plugin☠️ WARNING ☠️We are using 165% of our max size budget. Total Size: 24.14KB Gzipped: 9.38KB |
The review feedback's been addressed! |
R: @philipwalton
Fixes #1461
Small change needed to accommodate a quirk with the
Headers
constructor in Samsung Internet 6.4 (Chrome 56).