I'm currently trying to implement an Express application using the Serverless framework on API Gateway + Lambda. Everything worked as expected until I started introducing request signing on our end. The signing works in a way that it signs the complete URL including the query string using a secret token. Unfortunately it seems like either API Gateway or Cloudfront are re-sorting the query string alphabetically which leads to the checksum generated on our side to be different from the one the client generated.
What our Express server sees:
https://example.com/endpoint?build_number=1&platform=ios
What the client was sending:
https://example.com/endpoint?platform=ios &build_number=1
As you can see the query parameters got re-sorted alphabetically which is no behaviour I would expect.
Any idea?