浏览器中的 AWS API 网关 ERR_CONTENT_DECODING_FAILED [英] AWS API Gateway ERR_CONTENT_DECODING_FAILED in browser

查看:16
本文介绍了浏览器中的 AWS API 网关 ERR_CONTENT_DECODING_FAILED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的用例中,API Gateway 用作 HTTP 代理,使用以下默认设置 官方教程.

In my use case, API Gateway serves as an HTTP proxy, using default settings following official tutorial.

它在测试控制台或通过 curl 进行了测试.但是如果我在浏览器中访问链接或进行 AJAX 调用,我会得到 ERR_CONTENT_DECODING_FAILED.

It's tested working in test console or via curl. But if I access the link in browser or make an AJAX call, I'll get ERR_CONTENT_DECODING_FAILED.

API Gateway 似乎损坏了内容.相关问题.

It seems that API Gateway corrupt the content. Related issue.

有没有办法禁止 API Gateway 更改我的内容?我将 Content Handling 设置为 passthrough,但显然它正在改变我的内容.

Is there a way to forbid API Gateway changing my content? I set Content Handling to passthrough, but clearly it's changing my content.

推荐答案

添加静态集成请求头Accept-Encoding,值为'identity',这样AWS就赢了不要篡改您的请求.

Add a static integration request header Accept-Encoding with value 'identity', so that AWS won't tamper your request.

这篇关于浏览器中的 AWS API 网关 ERR_CONTENT_DECODING_FAILED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆