-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update put.js send 200 or 204 depending on pre-existance of resource #1785
Conversation
The HTTP spec says that the Server MUST return a 200 or 204 if PUT replaces and existing resource. See second paragraph of https://httpwg.org/specs/rfc9110#PUT. Brought up by @CxRes.
@jeff-zucker Just to confirm, should the successful PUT return a 200 or a 204, or the 200 and 201 as you changed? |
My understanding is that
I don't know in what circumstances, if any, NSS returns content from a PUT. If that never happens, my PR should be changed to make 204 the response when file pre-exists. If there are times when NSS does return content, those times should trigger a change from 204 to 200. |
If that is the case, changing 201 to 204 is adequate. I would update this, but I to have @jeff-zucker do it seems easier. |
Done. |
The tests are passing but I'll wait for Alain's input. |
@zg009 Some tests are failing, but that is mostly a simple matter of changing 201 to 204 status codes. What is non-trivial here is that we need to add a few more test cases to distinguish between 201 and 204 cases (i.e. we want coverage for both), which will add a few more tests. |
@CxRes Can you tell me which tests or the output? For some reason all of mine are still passing. I need to check if there is something wrong with my local repository or if it is another issue. |
@zg009 You can see this is the GitHub CI. |
Co-authored-by: Alain Bourgeois <[email protected]>
The HTTP spec says that the Server MUST return a 200 or 204 if PUT replaces and existing resource. See second paragraph of https://httpwg.org/specs/rfc9110#PUT.
Brought up by @CxRes.