Bug 226584 - Request.constructor misses checking for the type of input param
Summary: Request.constructor misses checking for the type of input param
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-03 08:11 PDT by zyscoder@gmail.com
Modified: 2021-06-07 01:31 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zyscoder@gmail.com 2021-06-03 08:11:26 PDT
Steps to reproduce:

(1) Open a tab and navigate to any URL;
(2) Run the following code in the Console of Devtools:
```
new Request(undefined)
```
(3) Then this code would be evaluated successfully without throwing any exception.

Actual results:

This code is evaluated successfully without throwing any exception.

Expected results:

As https://fetch.spec.whatwg.org/#requestinfo says, the input param is of RequestInfo type, and RequestInfo is of Request or USVString type. Since the code above sets the input param as undefined, a TypeError exception should be thrown.
Comment 1 youenn fablet 2021-06-07 01:30:50 PDT
I guess it is converted to a USVString.
Chrome and Firefox do have the same behavior.
Comment 2 youenn fablet 2021-06-07 01:31:34 PDT
I do not see a test for it, which might be good to add.
Closing as Invalid since all browsers behave the same.