mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Use same defaults as JS for fetch options (#20783)
* Use same defaults as JS for fetch options * Add changelog entry
This commit is contained in:
@@ -118,7 +118,7 @@
|
||||
|
||||
|
||||
- `std/net.IpAddress` dollar `$` improved, uses a fixed capacity for the `string` result based from the `IpAddressFamily`.
|
||||
|
||||
- `std/jsfetch.newFetchOptions` now has default values for all parameters
|
||||
|
||||
[//]: # "Additions:"
|
||||
- Added ISO 8601 week date utilities in `times`:
|
||||
|
||||
@@ -84,9 +84,9 @@ proc unsafeNewFetchOptions*(metod, body, mode, credentials, cache, referrerPolic
|
||||
"{method: #, body: #, mode: #, credentials: #, cache: #, referrerPolicy: #, keepalive: #, redirect: #, referrer: #, integrity: #, headers: #}".}
|
||||
## .. warning:: Unsafe `newfetchOptions`.
|
||||
|
||||
func newfetchOptions*(metod: HttpMethod; body: cstring;
|
||||
mode: FetchModes; credentials: FetchCredentials; cache: FetchCaches; referrerPolicy: FetchReferrerPolicies;
|
||||
keepalive: bool; redirect = frFollow; referrer = "client".cstring; integrity = "".cstring,
|
||||
func newfetchOptions*(metod = HttpGet; body: cstring = nil;
|
||||
mode = fmCors; credentials = fcSameOrigin; cache = fchDefault; referrerPolicy = frpNoReferrerWhenDowngrade;
|
||||
keepalive = false; redirect = frFollow; referrer = "client".cstring; integrity = "".cstring,
|
||||
headers: Headers = newHeaders()): FetchOptions =
|
||||
## Constructor for `FetchOptions`.
|
||||
result = FetchOptions(
|
||||
|
||||
Reference in New Issue
Block a user