Skip to content

Commit

Permalink
Force 'Accept-Encoding: identity' in CORS proxy requests
Browse files Browse the repository at this point in the history
We need to receive data unencoded, to prevent the further double-encoding
  • Loading branch information
davidmz committed Jan 5, 2025
1 parent 464f560 commit 9e96b1e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/api/v2/CorsProxyController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export async function proxy(ctx: Context) {
const timeoutMs = timeoutDuration.isValid ? timeoutDuration.toMillis() : fallbackTimeoutMs;

// Perform the request with timeout
const response = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) });
const response = await fetch(url, {
headers: { 'Accept-Encoding': 'identity' },
signal: AbortSignal.timeout(timeoutMs),
});

// Copying to the client:
// 1. The response status code
Expand Down

0 comments on commit 9e96b1e

Please sign in to comment.