• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-pkgz / routegroup
96%
master: 98%

Build:
Build:
LAST BUILD BRANCH: refs/tags/v1.5.3
DEFAULT BRANCH: master
Repo Added 22 Feb 2024 08:55AM UTC
Files 1
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH refs/tags/v1.5.0
branch: refs/tags/v1.5.0
CHANGE BRANCH
x
Reset
  • refs/tags/v1.5.0
  • better-root-handling
  • catch-all
  • cleanup
  • custom-not-found
  • feat/handle-root-without-redirect
  • fix-405-response
  • fix-issue-24-double-middleware
  • fix-issue-27-notfound-vs-405
  • fix-path-params-issue-22
  • master
  • mux-compat
  • pr19
  • refs/tags/v0.1.0
  • refs/tags/v0.1.1
  • refs/tags/v0.2.0
  • refs/tags/v0.2.1
  • refs/tags/v0.3.0
  • refs/tags/v0.4.0
  • refs/tags/v0.5.0
  • refs/tags/v1.0.0
  • refs/tags/v1.1.0
  • refs/tags/v1.1.1
  • refs/tags/v1.2.0
  • refs/tags/v1.3.0
  • refs/tags/v1.3.1
  • refs/tags/v1.4.0
  • refs/tags/v1.4.1
  • refs/tags/v1.5.1
  • refs/tags/v1.5.2
  • refs/tags/v1.5.3
  • static-files
  • update-golangci-lint

08 Aug 2025 08:06AM UTC coverage: 95.93% (-4.1%) from 100.0%
16825395520

push

github

web-flow
Fix HTTP 405 Method Not Allowed responses (#21)

* Fix HTTP 405 Method Not Allowed responses

This change fixes incorrect HTTP status code handling where wrong HTTP methods
on existing routes were returning 404 Not Found instead of 405 Method Not Allowed.

Key changes:
- Remove automatic catch-all route registration that was intercepting requests
- Apply root middlewares at serve time instead of route registration time
- Preserve standard library's HTTP method matching behavior
- Add middleware ordering enforcement with panic on misuse
- Maintain backward compatibility with DisableNotFoundHandler as no-op

The new architecture properly distinguishes between:
- 404 Not Found: path doesn't exist
- 405 Method Not Allowed: path exists but method not supported

This preserves HTTP semantics while still allowing global middleware application
and custom 404 handlers when needed.

* Fix improper defer usage in test loops

Replace defer statements inside loops with explicit Close() calls
at the end of each iteration. Using defer in loops causes all
deferred calls to accumulate until function exit, potentially
causing resource leaks with many iterations.

Also properly handle Close() errors instead of ignoring them.

* Clarify that custom NotFoundHandler receives global middlewares

Add explicit documentation that custom 404 handlers have the root
bundle's global middlewares applied to them, ensuring consistency
with the overall middleware application design.

63 of 70 new or added lines in 1 file covered. (90.0%)

7 existing lines in 1 file now uncovered.

165 of 172 relevant lines covered (95.93%)

28.8 hits per line

Relevant lines Covered
Build:
Build:
172 RELEVANT LINES 165 COVERED LINES
28.8 HITS PER LINE
Source Files on refs/tags/v1.5.0
  • List 1
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
16825395520 refs/tags/v1.5.0 Fix HTTP 405 Method Not Allowed responses (#21) * Fix HTTP 405 Method Not Allowed responses This change fixes incorrect HTTP status code handling where wrong HTTP methods on existing routes were returning 404 Not Found instead of 405 Method Not ... push 08 Aug 2025 08:09AM UTC web-flow github
95.93
See All Builds (122)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc