lunakv / academyruins-api

Rules API for Magic: The Gathering
https://api.academyruins.com/docs
GNU Affero General Public License v3.0
4 stars 1 forks source link

Normalize trailing slashes in URLs #30

Open lunakv opened 1 year ago

lunakv commented 1 year ago

Some routes return 307s when sent without a trailing slash. Some return 307 when sent with one. We should make the slash irrelevant and just return the response.

FastAPI doesn't fully support this nicely, so the way to do it is probably with a combination of making sure the line without the trailing slash is always the canonical one (this is not true for router roots), then strip the slash in the nginx proxy.