Bug 226584

Summary: Request.constructor misses checking for the type of input param
Product: WebKit Reporter: zyscoder <zyscoder>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: achristensen, bugs-noreply, mcatanzaro, sam, youennf
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

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.