Add support for lowercase HTTP methods in route() method#4747
Add support for lowercase HTTP methods in route() method#4747ashikkabeer wants to merge 0 commit intofastify:mainfrom
Conversation
jsumners
left a comment
There was a problem hiding this comment.
Please add unit tests to cover this.
|
@jsumners I don't really know how to write unit tests. Can you help me with some information on that? I saw there are many frameworks for that. What framwork should i use ? |
|
See /test/route.js You basically have to do: I didnt test it, wrote it on my mobile. But you should get the gist... |
fastify.js
Outdated
| // otherwise we should bind it after the declaration | ||
|
|
||
| if (typeof options.method === 'string') { | ||
| options.method = options.method.toUpperCase(); |
There was a problem hiding this comment.
Note that this method could be an array, so we should support method: ['get', 'POST'] too
|
@Uzlopak I got this error FAIL test/route.test.js 1 failed of 187 7s |
|
Sry, i saw now, that you commented. I thought, that you closed out of frustration. I opened #4750 as a follow up PR. It was imho a little bit more complicated to implement it properly. |
|
I wasn't frustrated or anything. I closed it accidentally. I'm starting to do OpenSource contributions and this is my first code contribution attempt. :) |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Checklist
npm run testandnpm run benchmarkand the Code of conduct