aws / aws/aws-lambda-go

`headerClientContext` should match `aws-sdk-go-v2`

Open
#568 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

**Is your feature request related to a problem? Please describe.**

`aws-sdk-go-v2` sets the header `"X-Amz-Client-Context"`:

```
if v.ClientContext != nil && len(*v.ClientContext) > 0 {
locationName := "X-Amz-Client-Context"
encoder.SetHeader(locationName).String(*v.ClientContext)
}
```
https://github.com/aws/aws-sdk-go-v2/blob/main/service/lambda/serializers.go#L2815C19-L2815C38

but this library reads the header `"Lambda-Runtime-Client-Context"`

```
headerClientContext = "Lambda-Runtime-Client-Context"
...
func parseClientContext(invoke *invoke, out *lambdacontext.ClientContext) error {
clientContextJSON := invoke.headers.Get(headerClientContext)
if clientContextJSON != "" {
if err := json.Unmarshal([]byte(clientContextJSON), out); err != nil {
return fmt.Errorf("failed to unmarshal client context json: %v", err)
}
}
return nil
}
```
https://github.com/aws/aws-lambda-go/blob/main/lambda/invoke_loop.go#L150
https://github.com/aws/aws-lambda-go/blob/main/lambda/runtime_api_client.go#L23C2-L23C21

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.