tournesol
tournesol copied to clipboard
URLs trailing slash
In most or our backend API URLs, there is a trailing "/". Some URLs (around 7 among 50) don't have it. From what I read, it's not really important whether there is a trailing slash or not. But it may be better to use a consistent rule, for homogeneity.
Moreover, the Tournesol URLs can be used both with or without the trailing slash. While it may be better for the users, that don't have to care about it, some websites speculate that it may be interpreted in some situations as duplicate content, and have a negative effect on SEO. I don't know if this is an issue, probably not.
Regarding the back end, we could indeed start by adding at trailing slash at the end of each URL for consistency within the API.
The APPEND_SLASH
settings should ensure the compatibility with old URLs wandering in the front end, but it doesn't seem to work on my local setup (I didn't test a lot).
https://docs.djangoproject.com/en/4.0/ref/settings/#append-slash
The OpenAPI schema should be updated during the process with yarn update-schema
.