readthedocs-fr / bin-server

Un outil pour héberger des snippets de code et les partager via une URL.
https://bin.readthedocs.fr
MIT License
14 stars 15 forks source link

POST /new -> 201 Location: ... instead of 3xx #163

Closed Julien00859 closed 2 years ago

Julien00859 commented 2 years ago

https://github.com/readthedocs-fr/bin-server/blob/9f39fef7feeb621cfa98c2a2e1e08f04a529dd55/bin/controller.py#L151

https://datatracker.ietf.org/doc/html/rfc9110#section-8.7

Julien00859 commented 2 years ago

If the result of processing a POST would be equivalent to a representation of an existing resource, an origin server redirect the user agent to that resource by sending a 303 (See Other) response with the existing resource's identifier in the Location field. This has the benefits of providing the user agent a resource identifier and transferring the representation via a method more amenable to shared caching, though at the cost of an extra request if the user agent does not already have the representation cached.

It is ok to redirect using 303 See Other

Julien00859 commented 2 years ago

Firefox doesn't automatically redirection upon 201+Location