Skip to content

Commit

Permalink
fix(observe): set Accept-Encoding header when fetching arns data
Browse files Browse the repository at this point in the history
Gateways may use CDNs to serve data. Those CDN's may return compressed data depending on their configuration. To avoid discrpencies, the observations should request the raw data  using the `Accept-Encoding: identity` header. 

Related PR: ar-io/ar-io-observer#53
  • Loading branch information
dtfiedler authored Nov 4, 2024
1 parent 60f5f31 commit e1ce570
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export const fetchWithTimeout = async (resource:string, options?:RequestInit, ti

const response = await fetch(resource, {
...options,
headers: {
...options?.headers,
'Accept-Encoding': 'identity'
},
signal: controller.signal
});
clearTimeout(id);
Expand Down

0 comments on commit e1ce570

Please sign in to comment.