feat: [net] add "priority" option to net.request#42628
feat: [net] add "priority" option to net.request#42628jkleinsc merged 1 commit intoelectron:mainfrom
Conversation
80f8e4f to
f86a56c
Compare
5835726 to
bdaaf91
Compare
bdaaf91 to
bb7f80b
Compare
nornagon
left a comment
There was a problem hiding this comment.
I'm no longer officially a maintainer, but I wrote a lot of this code so here's a review
| if ('priorityIncremental' in options) { | ||
| urlLoaderOptions.priorityIncremental = options.priorityIncremental; | ||
| } |
There was a problem hiding this comment.
any reason not to have this as a key in the object above unconditionally?
There was a problem hiding this comment.
To preserve the default value(true), otherwise the priorityIncremental will be false if it's unspecified and then assigned to undefined unconditionally.
|
I just go ahead and moved the test out. |
9a2b8a9 to
b11e4d8
Compare
|
All |
10623b9 to
042eada
Compare
document the default value of priority option Update the priority test to not use the httpbin.org as server Fixed the lint errors Fixed the build error
042eada to
c47d67b
Compare
|
Could you add the backport labels so this PR can be backported to other branches like 37-x-y and 36-x-y. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Release Notes Persisted
|
|
I have automatically backported this PR to "36-x-y", please check out #47320 |
|
I have automatically backported this PR to "37-x-y", please check out #47321 |
document the default value of priority option Update the priority test to not use the httpbin.org as server Fixed the lint errors Fixed the build error
Description of Change
Add the priority and priorityIncremental options to customize the Priority header of requests sent by net.request.
Currently all requests sent by net.request have a priority header with value
u=4, i, this maybe unexpected. We want it fully customizable and match the Chrome exactly if possible.Close #46680
Checklist
npm testpassesRelease Notes
Notes: Added the priority and priorityIncremental options to net.request()