tests(smokehouse): adopt URLSearchParams for querystring manipulation#3941
tests(smokehouse): adopt URLSearchParams for querystring manipulation#3941patrickhulce merged 5 commits intomasterfrom
Conversation
5856373 to
cd89a2e
Compare
|
|
||
| function headersParam(headers) { | ||
| return headers | ||
| .map(({name, value}) => `extra_header=${name}:${encodeURI(value)}`) |
There was a problem hiding this comment.
oh nice catch we should've been using encodeURIComponent here 👍
lighthouse-cli/test/cli/run-test.js
Outdated
| describe('CLI run', function() { | ||
| it('runLighthouse completes a LH round trip', () => { | ||
| const url = 'chrome://version'; | ||
| const url = 'chrome://version/'; |
There was a problem hiding this comment.
hang on, I just realized the comment around this. Are we doing something wrong here?
just tried this out in console, seems like a bad result if everything gets a trailing slash now
const URL = require('whatwg-url').URL
console.log(new URL('chrome://version').href) // 'chrome://version'
There was a problem hiding this comment.
Okay looks like special urls had a trailing slash for a little bit in the spec but it was changed.
web-platform-tests/wpt#4586
whatwg/url#213
jsdom/whatwg-url@9ec5618
However Chrome doesn't yet implement this change. As a result, it adds the trailing slash when it delivers the canonicalized URL over the devtools protocol. In the future this'll probably change, but for now we'll have to normalize between the spec-violating Chrome and the correct whatwg-url.
Doesn't look like there's a crbug for this, though there's a sprinkling of other issues documenting Chrome's URL failures on webplatformtests.
exciting. 🤒
big enough change you should lgtm again. :)
This is what I was thinking about for #3815.
wdyt?