feat: [net] add "priority" option to net.request (#42628)

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
This commit is contained in:
zeeker999 2025-05-31 03:28:13 +08:00 committed by GitHub
commit dc5efca0f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 103 additions and 2 deletions

View file

@ -288,8 +288,12 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod
origin: options.origin,
referrerPolicy: options.referrerPolicy,
cache: options.cache,
allowNonHttpProtocols: Object.hasOwn(options, kAllowNonHttpProtocols)
allowNonHttpProtocols: Object.hasOwn(options, kAllowNonHttpProtocols),
priority: options.priority
};
if ('priorityIncremental' in options) {
urlLoaderOptions.priorityIncremental = options.priorityIncremental;
}
const headers: Record<string, string | string[]> = options.headers || {};
for (const [name, value] of Object.entries(headers)) {
validateHeader(name, value);