CodeGenieApp / CodeGenieApp/serverless-express

Issue with json being returned as application/octet-stream

オープン
#435 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
5.3k
フォーク
676
PR マージ指標
30日以内にマージされた PR はありません

説明

I have a pretty standard implementation using the following:

```typescript
import serverlessExpress from '@vendia/serverless-express';
import { app } from '../app/app';

export const handler = serverlessExpress({ app });
```

and an endpoint that responds the following:

```typescript
healthCheck(request: Request, response: Response): Response {
const apiResponse = new ApiResponse({});

return response.json(apiResponse);
}

// apiResponse -> {"data":{},"code":200,"message":"Success"}
```

It's running over an AWS ALB, but the content-type being returned (wrongly) is application/octet-stream.

Is there any configuration to avoid this issue?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、AWS Application Load Balancer の背後にある TypeScript serverless-express handler を再現し、health-check endpoint のレスポンスヘッダーを調べます。JSON response が application/octet-stream ではなく application/json content type で返されれば、issue は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, express, node.js, typescript
領域
api, backend, cloud
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。