Skip to content

Conversation

@ggallotti
Copy link
Member

Referer Header is not working on Lambda because the "Referer" Header is being override by Jersey Lambda Container implementation.

In the future we should clone, fork and publish a new Jersey Lambda Container implementation and remove this special behaviour, instead of copying the Header.

This was needed urgently for TikTok LigaMX Angular App.

@genexusbot
Copy link
Collaborator

Cherry pick to beta success

@ggallotti ggallotti requested a review from iroqueta January 21, 2022 12:05
List<String> referer = awsProxyRequest.getMultiValueHeaders().get("Referer");
if (referer != null && !referer.isEmpty()) {
awsProxyRequest.getMultiValueHeaders().put("GX-Referer", referer);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And who is going to read the "GX-Referer" ?

Copy link
Member Author

@ggallotti ggallotti Jan 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Referer Header is required in Angular Applications to get the Query String of the original URL from the Server Side.

Due to AWS Lambda Jersey implementation, this Header is override by Lambda specific context.
We need to do a fork/clone or some class override in order to get the Referer Header working. In the meantime we are copying it.

@ggallotti ggallotti merged commit 32ca569 into master Jan 27, 2022
@ggallotti ggallotti deleted the lambda-referer branch January 27, 2022 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants