Need to add application/javascript and text/css as binary types for
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 30/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- aws, java, spring-boot
研究方向
從連結的 StreamLambdaHandler.java 範例開始,檢查 serverless 容器針對 AWS 回應的二進位內容設定。使用 springdoc-openapi-starter-webmvc-ui 重現問題,接著判斷是否應預設辨識 application/javascript 和 text/css;當 Swagger UI 資產能透過 API Gateway 載入,且涵蓋預期的回應行為時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
I don't know which component in the stack is wrong.
- springdoc-openapi-starter-webmvc-ui will serve up swagger-ui/index.html, locally 100% and when deployed to a AWS API Gateway (HTTP-style) only some .js files and the .html file serve, the rest blowing up in the API Gateway response with no error message
I think the minimal repro is to add springdoc-openapi-starter-webmvc-ui (via pom.xml) to the ping controller example (which is a bad name for an endpoint because it clashes with the automatically provided route of AWS API Gateway, I usually have to rename it to pong)
I told the container to treat application/javascript and text/css as binary and API Gateway stopped trying to do something (unnecessary encoding/decoding) to the response and now swagger-ui loads.
I'm leaving this here because other issues have run into the same problem and came up with worse workarounds (like stop even trying to serve some content types on API Gateway at all)
That this works locally in tomcat makes me think that something is wrong with API Gateway or serverless-container.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.6</version>
</dependency>
public class StreamLambdaHandler implements RequestStreamHandler, Resource {
private static SpringBootLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler;
static {
try {
handler = SpringBootLambdaContainerHandler.getAwsProxyHandler(Application.class);
LambdaContainerHandler.getContainerConfig().addBinaryContentTypes("application/javascript");
LambdaContainerHandler.getContainerConfig().addBinaryContentTypes("text/css");
} catch (ContainerInitializationException e) {
// if we fail here. We re-throw the exception to force another cold start
e.printStackTrace();
throw new RuntimeException("Could not initialize Spring Boot application", e);
}
}
}
- 主要語言
- Java
- 星號
- 1.6k
- 分支
- 575
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 12
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws/serverless-java-container 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
aws/serverless-java-container#1729 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
aws/serverless-java-container#1715 ·
維護者通常 1 天內回覆
-
Support for API Gateway mTLS clientCert field可能已有人在做 @2748109647 於 10 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 48/100
aws/serverless-java-container#1726 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 35/100
aws/serverless-java-container#1579 · 3 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 42/100
aws/serverless-java-container#1568 · 1 則留言 ·
維護者通常 1 天內回覆
查看 aws/serverless-java-container 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
ls1intum/thesis-management#1473 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
LunaDeerMC/Dominion#301 · 1 則留言 ·
-
[FEATURE] Expose external refresh, node-level translog and warmer stats可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉untriaged
難度 2/5 1-3 小時 新手友好度 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100