jss
jss copied to clipboard
[NextJS] REST Layout service ip resolving
Should resolve GeoIP / tracking issues when using REST Layout Service together with next application running in containerized environment.
- [x] This PR follows the Contribution Guide
- [ ] Changelog updated
Description / Motivation
When the REST Layout service is called from the Next application, when running containerized (instead of Vercel or other SWA environments) the x-forwarded-ip header should be forwarded instead of the socket remote address which can belong to a load balancer. Also replaced connection for socket as its deprecated since v16.
Testing Details
The solution should still be tested on other environments so it does not break functionality there.
- [x] Tested on local Development with traefik / docker.
- [ ] Tested on Vercel
- [ ] Test with Azure SWA
- [ ] Tested on AKS / ingress container
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
@mathijs-b2m Thanks for your report and contribution! I've created a ticket with all the details in our internal backlog to review and merge PR.