Body of events.APIGatewayProxyRequest for Binary Data
- Vorherrschende Sprache
- Go
- Sterne
- 3.8k
- Forks
- 578
- Ø Merge
- 8 Std. 18 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
Hi !
We're testing binary data upload to lambda handler in Golang, but found something strange.
From Settings of API Gateway, there is one type *application/octet-stream* to support any binary format. It's using **AWS Lambda proxy integrations**, so that it doesn't need to set **content handling**.
The size local file file is **280432**, once uploaded to lambda Golang handler, the size of **events.APIGatewayProxyRequest::body** becomes **509869**. By printing the data of body which is a string, it _looks_ like binary with \u0000, but the boolean value **events.APIGatewayProxyRequest::IsBase64Encoded** is always still **false**. In contrast, use openssl to encode the local file in base64, the size of output file is only **379755**, much smaller than body.
Is there any extra tips to handle binary data properly ? Thanks in advance.
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit den Feldern body und IsBase64Encoded von events.APIGatewayProxyRequest und reproduzieren Sie anschließend den gemeldeten 280432-Byte-Upload von application/octet-stream über die AWS Lambda-Proxy-Integration. Vergleichen Sie den empfangenen body und das Flag mit den in der Ausgabe beschriebenen API Gateway-Einstellungen für Binärdaten. Als abgeschlossen gilt die Untersuchung, wenn dokumentiert ist, ob das Verhalten erwartet wird, und die für Binäruploads erforderliche Konfiguration oder Verarbeitung identifiziert wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, go
- Bereich
- api, backend, cloud
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 30/100