Rename field.

This commit is contained in:
Dillon Kearns 2023-01-07 15:31:54 -08:00
parent 7301530495
commit 766d6b02d7
4 changed files with 8 additions and 8 deletions

View File

@ -149,7 +149,7 @@ function lookupOrPerform(portsFile, mode, rawRequest, hasFsAccess, useCache) {
"User-Agent": "request",
...request.headers,
},
...rawRequest.useCache,
...rawRequest.cacheOptions,
});
console.timeEnd(`fetch ${request.url}`);

View File

@ -334,7 +334,7 @@ request request__ expect =
, headers = request__.headers
, method = request__.method
, body = request__.body
, useCache = request__.options |> Maybe.map encodeOptions
, cacheOptions = request__.options |> Maybe.map encodeOptions
}
in
requestRaw request_ expect
@ -409,7 +409,7 @@ requestRaw request__ expect =
:: request__.headers
, method = request__.method
, body = request__.body
, useCache = request__.useCache
, cacheOptions = request__.cacheOptions
}
in
Request

View File

@ -11,7 +11,7 @@ type alias Request =
, method : String
, headers : List ( String, String )
, body : Body
, useCache : Maybe Encode.Value
, cacheOptions : Maybe Encode.Value
}
@ -40,5 +40,5 @@ codec =
|> Codec.field "method" .method Codec.string
|> Codec.field "headers" .headers (Codec.list (Codec.tuple Codec.string Codec.string))
|> Codec.field "body" .body StaticHttpBody.codec
|> Codec.nullableField "useCache" .useCache Codec.value
|> Codec.nullableField "cacheOptions" .cacheOptions Codec.value
|> Codec.buildObject

View File

@ -273,7 +273,7 @@ all =
, headers =
[]
, body = BackendTask.Http.emptyBody
, useCache = Nothing
, cacheOptions = Nothing
}
(StringBody "This is a raw text file.")
|> expectSuccess []
@ -813,7 +813,7 @@ get url =
, url = url
, headers = []
, body = BackendTask.Http.emptyBody
, useCache = Nothing
, cacheOptions = Nothing
}
@ -823,7 +823,7 @@ post url =
, url = url
, headers = []
, body = BackendTask.Http.emptyBody
, useCache = Nothing
, cacheOptions = Nothing
}