You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section documents parts of the [Fetch Standard](https://fetch.spec.whatwg.org) that Undici does
266
+
This section documents parts of the [HTTP/1.1](https://www.rfc-editor.org/rfc/rfc9110.html) and [Fetch Standard](https://fetch.spec.whatwg.org) that Undici does
267
267
not support or does not fully implement.
268
268
269
-
##### Garbage Collection
269
+
#### CORS
270
+
271
+
Unlike browsers, Undici does not implement CORS (Cross-Origin Resource Sharing) checks by default. This means:
272
+
273
+
- No preflight requests are automatically sent for cross-origin requests
274
+
- No validation of `Access-Control-Allow-Origin` headers is performed
275
+
- Requests to any origin are allowed regardless of the source
276
+
277
+
This behavior is intentional for server-side environments where CORS restrictions are typically unnecessary. If your application requires CORS-like protections, you will need to implement these checks manually.
The [Fetch Standard](https://fetch.spec.whatwg.org) requires implementations to exclude certain headers from requests and responses. In browser environments, some headers are forbidden so the user agent remains in full control over them. In Undici, these constraints are removed to give more control to the user.
318
328
319
-
### `undici.upgrade([url, options]): Promise`
329
+
####`undici.upgrade([url, options]): Promise`
320
330
321
331
Upgrade to a different protocol. See [MDN - HTTP - Protocol upgrade mechanism](https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism) for more details.
322
332
@@ -378,20 +388,15 @@ Returns: `URL`
378
388
***protocol**`string` (optional)
379
389
***search**`string` (optional)
380
390
381
-
## Specification Compliance
382
-
383
-
This section documents parts of the HTTP/1.1 specification that Undici does
384
-
not support or does not fully implement.
385
-
386
-
### Expect
391
+
#### Expect
387
392
388
393
Undici does not support the `Expect` request header field. The request
389
394
body is always immediately sent and the `100 Continue` response will be
***ignoreTrailingSlash**`boolean` (optional) - Default: `false` - set the default value for `ignoreTrailingSlash` for interceptors.
22
22
23
+
***acceptNonStandardSearchParameters**`boolean` (optional) - Default: `false` - set to `true` if the matcher should also accept non standard search parameters such as multi-value items specified with `[]` (e.g. `param[]=1¶m[]=2¶m[]=3`) and multi-value items which values are comma separated (e.g. `param=1,2,3`).
24
+
23
25
### Example - Basic MockAgent instantiation
24
26
25
27
This will instantiate the MockAgent. It will not do anything until registered as the agent to use with requests and mock interceptions are added.
0 commit comments