Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

headerClientContext should match aws-sdk-go-v2 #568

Open
nalbion opened this issue Aug 1, 2024 · 0 comments
Open

headerClientContext should match aws-sdk-go-v2 #568

nalbion opened this issue Aug 1, 2024 · 0 comments

Comments

@nalbion
Copy link

nalbion commented Aug 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant