It seems as if between when that PR was done and now, AWS has added back the ability to use this endpoint without trailing slash. Some drivers/libraries using AWS authentication do not respect redirects (like the MongoDB Nodejs driver), and use the URL without trailing slash. This causes them to not work with KIAM.
I tested the metadata service directly with a couple different families (t3, m5, r5, c4), and they seem to all respond without a redirect (just a 200 with the role name) when trying the URL without trailing slash.
This PR reverts #121, with added test.
It seems as if between when that PR was done and now, AWS has added back the ability to use this endpoint without trailing slash. Some drivers/libraries using AWS authentication do not respect redirects (like the MongoDB Nodejs driver), and use the URL without trailing slash. This causes them to not work with KIAM.
I tested the metadata service directly with a couple different families (t3, m5, r5, c4), and they seem to all respond without a redirect (just a 200 with the role name) when trying the URL without trailing slash.