mirror of
https://github.com/sussy-code/sudo-proxy.git
synced 2026-01-11 20:10:18 +00:00
Fix for netlify stupid encoding issue
Some checks failed
Linting and Testing / Run Linters (push) Has been cancelled
Linting and Testing / Build project (push) Has been cancelled
Linting and Testing / Build docker (push) Has been cancelled
Docker Publish / build (push) Has been cancelled
Release / Release (push) Has been cancelled
Some checks failed
Linting and Testing / Run Linters (push) Has been cancelled
Linting and Testing / Build project (push) Has been cancelled
Linting and Testing / Build docker (push) Has been cancelled
Docker Publish / build (push) Has been cancelled
Release / Release (push) Has been cancelled
This commit is contained in:
parent
d698358f64
commit
46560bac90
2 changed files with 2795 additions and 2198 deletions
4983
pnpm-lock.yaml
4983
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -57,6 +57,16 @@ export async function specificProxyRequest(
|
|||
|
||||
const method = opts.fetchOptions?.method || event.method;
|
||||
const oldHeaders = getProxyRequestHeaders(event);
|
||||
|
||||
// netlify seems to be changing the content-encoding header to gzip when the reponse is encoded in zstd
|
||||
// so as temp fix just not sending zstd in accept encoding
|
||||
if (oldHeaders['accept-encoding']?.includes('zstd'))
|
||||
oldHeaders['accept-encoding'] = oldHeaders['accept-encoding']
|
||||
.split(',')
|
||||
.map((x: string) => x.trim())
|
||||
.filter((x: string) => x !== 'zstd')
|
||||
.join(', ');
|
||||
|
||||
opts.blacklistedHeaders?.forEach((header) => {
|
||||
const keys = Object.keys(oldHeaders).filter(
|
||||
(v) => v.toLowerCase() === header.toLowerCase(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue