CodeGenieApp / CodeGenieApp/serverless-express
Issue with json being returned as application/octet-stream
- Ngôn ngữ chính
- JavaScript
- Star
- 5.3k
- Fork
- 676
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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?
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện handler serverless-express TypeScript phía sau AWS Application Load Balancer và kiểm tra các header phản hồi của health-check endpoint. Issue được hoàn tất khi JSON response được trả về với application/json content type thay vì application/octet-stream.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws, express, node.js, typescript
- Lĩnh vực
- api, backend, cloud
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100