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

AWS Amplify masks my user-agent header. #211

Open
caiodounis opened this issue Feb 20, 2023 · 8 comments
Open

AWS Amplify masks my user-agent header. #211

caiodounis opened this issue Feb 20, 2023 · 8 comments

Comments

@caiodounis
Copy link

caiodounis commented Feb 20, 2023

This is working well in my local but it's not working in my live project. After deploying a Next.js app on AWS Amplify when inspecting the request headers, the User Agent header is Amazon CloudFront instead of the user's user agent.

Do you guys have any idea how to fix this?

@saint777
Copy link

saint777 commented Apr 9, 2023

Probably in AWS settings

@mauricioA0
Copy link

are you using Next?

@p00000001
Copy link

@caiodounis - did you ever find a solution for this? I have the same problem with a Next.js app hosted on AWS Amplify

@belyas
Copy link

belyas commented Nov 14, 2023

Anyone has found a solution for this, I'm experiencing recently the same issue, we've just playing with Amplify to see if it's a good choice to move to or not, but this user agent forwarding is a pain, any help would be appreciated

@TimMikeladze
Copy link

TimMikeladze commented Nov 14, 2023

I'm not sure how accurate this workaround is but in my case I logged the incoming headers and noticed that the following headers have some information about the user agent.

const browser = headers[`sec-ch-ua`];

const platform = headers[`sec-ch-ua-platform`];

@belyas
Copy link

belyas commented Nov 14, 2023

Thanks @TimMikeladze yes I noticed those headers, they're unfortunately unreliable as they're still experimental headers and some vendors don't send them

@p00000001
Copy link

p00000001 commented Nov 14, 2023

@belyas Still waiting! I raised this as a bug in AWS Amplify but they changed it to a feature request and haven't given any feedback. Any additional thumbs-up on the issue would be useful to try and get them to look at it:

aws-amplify/amplify-hosting#3658

@belyas
Copy link

belyas commented Nov 14, 2023

@belyas Still waiting! I raised this as a bug in AWS Amplify but they changed it to a feature request and haven't given any feedback. Any additional thumbs-up on the issue would be useful to try and get them to look at it:

aws-amplify/amplify-hosting#3658

Thanks @p00000001 I did leave a thumbs-up and a comment to boost it hopefully or at least some useful/sustainable workaround at least for now

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

6 participants