Skip to content

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

Description

@nalbion

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions