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

alexferl / zerohttp / 23968847330
94%

Build:
DEFAULT BRANCH: master
Ran 04 Apr 2026 01:55AM UTC
Jobs 1
Files 93
Run time 1min
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

04 Apr 2026 01:54AM UTC coverage: 93.938% (-0.005%) from 93.943%
23968847330

push

github

web-flow
fix(mediatype): correct DefaultType to set Accept header on request (#165)

* fix(mediatype): correct DefaultType to set Accept header on request

The DefaultType config was incorrectly trying to set the response
Content-Type via a response writer wrapper. This never worked in
practice because renderers (R.JSON, etc.) always set their own
Content-Type headers, overwriting the middleware's value.

Changed DefaultType to instead set the Accept header on the request
when the client sends an empty Accept header or */*, allowing
handlers to perform proper content negotiation.

Signed-off-by: alexferl <me@alexferl.com>

* fix(mediatype): correct DefaultType, wildcard matching, and validation

- DefaultType now sets request Accept header (not response Content-Type)
- Add bidirectional wildcard matching: client `type/*` matches server types
- Fix chunked body validation: check ContentLength != 0 (not > 0)
- Fix suffix wildcards: `+*` patterns require a suffix to match
- Make suffix matching symmetric: both sides must agree
- Remove redundant hasSuffix checks

Signed-off-by: alexferl <me@alexferl.com>

---------

Signed-off-by: alexferl <me@alexferl.com>

35 of 35 new or added lines in 1 file covered. (100.0%)

4 existing lines in 2 files now uncovered.

10537 of 11217 relevant lines covered (93.94%)

434.12 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
96.69
-0.21% middleware/mediatype/media_type.go
2
95.24
0.0% sse/sse.go
Jobs
ID Job ID Ran Files Coverage
1 23968847330.1 04 Apr 2026 01:55AM UTC 93
93.94
GitHub Action Run
Source Files on build 23968847330
  • Tree
  • List 93
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23968847330
  • c8e68990 on github
  • Prev Build on master (#23967486078)
  • Next Build on master (#23969338537)
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

© 2026 Coveralls, Inc