Need to add application/javascript and text/css as binary types for
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- aws, java, spring-boot
調査の方向性
リンクされている StreamLambdaHandler.java の例から始め、AWS レスポンスに対する serverless コンテナのバイナリコンテンツ設定を調査します。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時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 件 ·
メンテナーはふだん 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンuntriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100