How to make the AWS API Gateway request path case insensitive

Viewed 5180
2 Answers

Unfortunately API Gateway, like most of AWS' offerings, is case-sensitive by design.

You therefore have two options:

I would recommend the CloudFront approach, as its cheaper and easier to maintain. However for a small API you might be tempted to go for the second, especially if you can host the whole API in a single lambda.

n.b. The internet is case-sensitive (and mostly it's lowercase), for example: http://www.bbc.co.uk/news/world-europe-12083491 vs http://www.bbc.co.uk/news/world-Europe-12083491

There's a third and much easier solution to this, but it might perhaps be a little dirty for a production environment. You can add the camelCase and PascalCase variations of your base path, since these are the ones most likely to be used. That's what I've done with my base path for a single API Gateway and it works.

API gateway resources are also case sensitive so the approaches described above are more thorough ways to make your request path case insensitive, since mine only helps with the base path.

Related