-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error decoding response from proxy #1343
Comments
After a longer digging phase and debugging of the situation I found that removing the
async query(ctx) {
[...]
// Remove headers that we don't want to be transfered
response.headers.delete('content-length');
response.headers.delete('connection');
// ADDED THIS LINE
response.headers.delete('content-encoding');
return {
ok: true,
body: responseBody,
headers: Object.fromEntries(response.headers.entries()),
status: response.status,
statusText: response.statusText
};
[...]
} Did I miss something ? |
Ahh, well spotted! |
@Laurin-W IMO the goal of the proxy is to return a response as close to the actual server's response as possible. That's of course, only what I understand of the situation, I may really miss something here ! |
Bug description
When requesting some URI through the proxy from an activity pods application, there is a discrepency between original encoding format and proxy's format and the client can't decode the response.
Steps to reproduce
CURL example with a local pod provider :
curl --location 'http://localhost:3000/sylvain/proxy'
--header 'sec-ch-ua-platform: "Windows"'
--header 'authorization: Bearer
--header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'
--header 'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"'
--header 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundary1HjF3ICd4MwIyf5m'
--header 'sec-ch-ua-mobile: ?0'
--header 'Accept: /'
--header 'Sec-Fetch-Site: same-site'
--header 'Sec-Fetch-Mode: cors'
--header 'Sec-Fetch-Dest: empty'
--header 'host: localhost'
--form 'headers="{"accept":"application/ld+json"}"'
--form 'id="https://mastodon.social/users/nixCraft"'
--form 'method="GET"'
Expected behaviour
Get a response equivalent to the one from the mastodon instance
Screenshots
From chrome :
From postman console :
The text was updated successfully, but these errors were encountered: