-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: adds webdav methods that require body & content type parsing #5411
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some tests for them?
These methods are already tested in the PR I mentioned |
Seems |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test is needed
Oh this PR is fine, my mistake I meant to talk about this issue where you suggested backporting #4409, that would be breaking |
The modified tests simply changed the execution at: https://github.com/fastify/fastify/pull/5411/files#diff-15a9e086692377c86b02752c54c928f4ca6f697758fc5dacc09bbde1d2dff96bR32-R45 Not sure if coverage is enabled but now the case where content-type is undefined may not be getting tested, so I think it would be better to add these as separate tests; just add one more request to each test with the header |
docs/Reference/Routes.md
Outdated
@@ -42,7 +42,7 @@ fastify.route(options) | |||
[here](./Validation-and-Serialization.md) for more info. | |||
|
|||
* `body`: validates the body of the request if it is a POST, PUT, PATCH, | |||
TRACE, or SEARCH method. | |||
TRACE, SEARCH, PROPFIND, PROPPATCH, LOCK or UNLOCK method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also not familiar with webdav but just pointing out that UNLOCK method wasn't added anywhere if that was unintentional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a check in the webdav RFC, UNLOCK method does not require a body, a mistake fixed in 54bf25c
I forgot to update the doc, sorry !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in d59e594
Done in 97ff092 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Just a note: tests were modified, which means behavior has changed, but these methods work with a body, and it really seems like an oversight from the original PR that added them, so I take it as a bugfix |
It depends on the methods concerned but the RFC is rather flexible as you can see here (https://datatracker.ietf.org/doc/html/rfc4918#section-9.1) :
Overall I agree with you, I think that indeed the tests were not complete but part of the implementation was missing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
npm run test
andnpm run benchmark
and the Code of conduct
Adds webdav methods that require parsing, missing from this PR: #3836