jordi fita mas 0b74c7a91c Instruct htmx that HTTP 422 is not a “fatal error”
I use HTTP 422 to signal that a form was submitted with bad data,
which i believe is the correct status code: “indicates that the server
understands the content type of the request content […], and the syntax
of the request content is correct, but it was unable to process the
contained instructions.”[0]

htmx, however, treats all 4xx status codes as error and, by default,
does not swap the target with the response’s content.  Until i found out
that i could change that behaviour, i worked around this limitation by
returning HTTP 200 for htmx requests, but it is a waste of time given
that htmx _can_ accept HTTP 422 as a non-error.

[0]: https://www.rfc-editor.org/rfc/rfc9110#name-422-unprocessable-content
2024-08-27 11:07:39 +02:00
2023-01-30 16:42:15 +01:00
2023-01-15 04:08:35 +01:00
2024-02-06 17:43:05 +01:00
Description
No description provided
https://numerus.cat/ 6.5 MiB
v1 Latest
2023-07-03 09:33:09 +00:00
Languages
PLpgSQL 64.2%
Go 21.4%
CSS 11.6%
JavaScript 2%
Scheme 0.7%