@@ -9,16 +9,18 @@ export { GetUrlResponse, Options };
99export async function getUrl ( href : string , options ?: Options ) : Promise < GetUrlResponse > {
1010 if ( options == null ) { options = { } ; }
1111
12- const request = {
12+ const request : RequestInit = {
1313 method : ( options . method || "GET" ) ,
1414 headers : ( options . headers || { } ) ,
1515 body : ( options . body || undefined ) ,
16+ } ;
1617
17- mode : < RequestMode > "cors" , // no-cors, cors, *same-origin
18- cache : < RequestCache > "no-cache" , // *default, no-cache, reload, force-cache, only-if-cached
19- credentials : < RequestCredentials > "same-origin" , // include, *same-origin, omit
20- redirect : < RequestRedirect > "follow" , // manual, *follow, error
21- referrer : "client" , // no-referrer, *client
18+ if ( options . skipFetchSetup !== true ) {
19+ request . mode = < RequestMode > "cors" ; // no-cors, cors, *same-origin
20+ request . cache = < RequestCache > "no-cache" ; // *default, no-cache, reload, force-cache, only-if-cached
21+ request . credentials = < RequestCredentials > "same-origin" ; // include, *same-origin, omit
22+ request . redirect = < RequestRedirect > "follow" ; // manual, *follow, error
23+ request . referrer = "client" ; // no-referrer, *client
2224 } ;
2325
2426 const response = await fetch ( href , request ) ;
0 commit comments