aws / aws/aws-lambda-go

Body of events.APIGatewayProxyRequest for Binary Data

Open
#331 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
3.8k
Forks
578
Avg merge
8h 18m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start with the events.APIGatewayProxyRequest body and IsBase64Encoded fields, then reproduce the reported 280432-byte application/octet-stream upload through the AWS Lambda proxy integration. Compare the received body and flag with the API Gateway binary-data settings described in the issue. Done means documenting whether the behavior is expected and identifying the configuration or handling needed for binary uploads.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
api, backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.