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

go-pkgz / routegroup / 16825352665
98%

Build:
DEFAULT BRANCH: master
Ran 08 Aug 2025 08:07AM UTC
Jobs 1
Files 1
Run time 423min
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

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

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

New Missed Lines in Diff

Lines Coverage ∆ File
7
95.93
-4.07% group.go

Uncovered Existing Lines

Lines Coverage ∆ File
7
95.93
-4.07% group.go
Jobs
ID Job ID Ran Files Coverage
1 16825352665.1 08 Aug 2025 08:07AM UTC 1
95.93
GitHub Action Run
Source Files on build 16825352665
  • Tree
  • List 1
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • fa4e8ae7 on github
  • Prev Build on master (#15480088302)
  • Next Build on master (#16826134538)
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