Skip to content

Commit

Permalink
fix: edge gateway denylist sync no cache request header
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Jun 24, 2022
1 parent 64468d1 commit 33844e8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/edge-gateway/scripts/denylist.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fetch from '@web-std/fetch'
import fetch, { Headers } from '@web-std/fetch'
import path from 'path'
import toml from 'toml'
import { CID } from 'multiformats'
Expand Down Expand Up @@ -67,7 +67,13 @@ async function getWranglerToml(url) {
}

async function getDenyList(url) {
const res = await fetch(url)
const headers = new Headers()
headers.append('cache-control', 'no-cache')
headers.append('pragma', 'no-cache')

const res = await fetch(url, {
headers,
})
if (!res.ok) {
throw new Error(`unexpected status fetching denylist.json: ${res.status}`)
}
Expand Down

0 comments on commit 33844e8

Please sign in to comment.