Use a single list of supported HTTP methods
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 40/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- backend
Research direction
Start with %supported_http_methods in Dancer2::Core::Types, which drives the 405 check in Dancer2::Core::App, then compare it with the default method list in Dancer2::Core::DSL's any. Also look at the body-parsing methods in Dancer2::Core::Request and the is_* predicates there. The tests named in the issue (t/http_methods.t, t/dsl/any.t, t/classes/Dancer2-Core-Request/new.t) should loop over one shared list. Done means every consumer reads from that single list, with no behaviour change and the existing tests passing. Settle the design with the maintainers first.
Written by the indexing model from the issue text.
Description
Adding QUERY in #1846 meant updating the list of HTTP methods in a bunch of different places. Miss one and you get a half-supported method. We almost did: any didn't match QUERY until @bigpresh caught it in review. He also pointed out we should really have one list of methods, so I'm opening this so it doesn't get lost.
Right now the method lists live in:
%supported_http_methodsin Dancer2::Core::Types (closest thing we have to a canonical list, and it drives the 405 check in Dancer2::Core::App)- the default method list for
anyin Dancer2::Core::DSL - the methods
deserializeparses a body for in Dancer2::Core::Request (intentionally a subset, but still maintained by hand) - the
is_*predicates in Dancer2::Core::Request - t/http_methods.t, t/dsl/any.t, and t/classes/Dancer2-Core-Request/new.t, each with their own copy
I'd like %supported_http_methods (or something like it) to be the one source. any would build its default list from it. We'd mark there which methods carry a body, so deserialize can use that too. The tests would loop over the same list, so a new method gets tested automatically. The is_* predicates could probably be generated from it as well.
No change in behavior. Next time a new method comes along, adding it should be a one-line change.
- Dominant language
- Perl
- Stars
- 604
- Forks
- 287
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PerlDancer/Dancer2
-
Add .gitattributes so share/skel keeps LF on a Windows git checkoutPossibly taken @sadhana-s-codez claimed this 2 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
PerlDancer/Dancer2#1854 · 1 comment ·
Maintainers usually reply within 1 day
-
dancer2 gen -c writes the Dockerfile outside the app directoryPossibly taken @sjh9714 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1851 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PerlDancer/Dancer2#1850 ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
PerlDancer/Dancer2#1820 ·
Maintainers usually reply within 1 day
-
Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1819 ·
Maintainers usually reply within 1 day
All issues in PerlDancer/Dancer2
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
jimsalterjrs/sanoid#1116 · 1 reaction ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
major/MySQLTuner-perl#1007 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
bioconda/bioconda-recipes#70187 ·
Maintainers usually reply within 2 days