CodeGenieApp / CodeGenieApp/serverless-express

Issue with json being returned as application/octet-stream

Offen
#435 1 Kommentar 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
5.3k
Forks
676
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reproducing the TypeScript serverless-express handler behind an AWS Application Load Balancer and inspect the response headers for the health-check endpoint. The issue is done when the JSON response is returned with an application/json content type rather than application/octet-stream.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, express, node.js, typescript
Bereich
api, backend, cloud
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.