Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Use a single list of supported HTTP methods

Open
#1,852 0 comments 0 reactions 0 assignees View on GitHub

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_methods in 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 any in Dancer2::Core::DSL
  • the methods deserialize parses 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PerlDancer/Dancer2

All issues in PerlDancer/Dancer2

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.