fix: fix obsolete calls

This commit is contained in:
Yarmo Mackenbach 2023-07-13 10:37:36 +02:00
parent e6228ed22e
commit 0c0d9a9ec3
No known key found for this signature in database
GPG key ID: 3C57D093219103A3

View file

@ -52,7 +52,7 @@ const handleBrowserRequests = (data, opts) => {
return createProxyRequestPromise(data, opts)
case ProxyPolicy.NEVER:
switch (data.proof.request.access) {
switch (data.proof.request.accessRestriction) {
case ProofAccessRestriction.NONE:
case ProofAccessRestriction.GRANTED:
return createDefaultRequestPromise(data, opts)
@ -66,7 +66,7 @@ const handleBrowserRequests = (data, opts) => {
}
case ProxyPolicy.ADAPTIVE:
switch (data.proof.request.access) {
switch (data.proof.request.accessRestriction) {
case ProofAccessRestriction.NONE:
return createFallbackRequestPromise(data, opts)
case ProofAccessRestriction.NOCORS:
@ -151,8 +151,8 @@ const createProxyRequestPromise = (data, opts) => {
const requestData = {
url: proxyUrl,
format: data.proof.request.format,
fetcherTimeout: fetcher[data.proof.request.fetcher].timeout
format: data.proof.response.format,
fetcherTimeout: data.proof.request.fetcher in fetcher ? fetcher[data.proof.request.fetcher].timeout : 30000
}
fetcher.http
.fn(requestData, opts)