tournesol icon indicating copy to clipboard operation
tournesol copied to clipboard

URLs trailing slash

Open glerzing opened this issue 2 years ago • 1 comments

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.

glerzing avatar Jul 15 '22 03:07 glerzing

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.

GresilleSiffle avatar Oct 05 '22 13:10 GresilleSiffle