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

go-pkgz / rest
97%

Build:
DEFAULT BRANCH: master
Repo Added 14 Jul 2018 07:41PM UTC
Files 25
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 master
branch: master
CHANGE BRANCH
x
Reset
  • master
  • 1.1.3
  • add-ping-head-support
  • apache-log
  • benchmarks
  • cors-preflight-vary
  • dependabot/go_modules/go_modules-5a9c29dde4
  • dependabot/go_modules/go_modules-a3c8a40308
  • dependabot/go_modules/go_modules-dd7da38a6b
  • dependabot/go_modules/go_modules-ee7f9554a6
  • feat/logger-bodyfn
  • fix-ci-caching
  • fix-content-type-header
  • fix/benchmarks-deterministic-timing
  • fix/cache-control-preconditions
  • fix/cors-credentials-wildcard
  • fix/gzip-hijack-error-path
  • fix/gzip-response-negotiation
  • fix/gzip-writer-capabilities
  • fix/middleware-findings
  • fix/onlyfrom-exact-ip
  • fs-opts
  • hashed-auth
  • health
  • new-middlewares
  • paskal/add_ipv4_link_local
  • paskal/golangci_lint
  • paskal/remove_errors
  • rbac
  • realip
  • realip-cdn-support
  • refs/tags/v1.10.0
  • refs/tags/v1.11.0
  • refs/tags/v1.12.0
  • refs/tags/v1.12.1
  • refs/tags/v1.13.0
  • refs/tags/v1.14.0
  • refs/tags/v1.15.0
  • refs/tags/v1.15.1
  • refs/tags/v1.15.2
  • refs/tags/v1.15.3
  • refs/tags/v1.15.4
  • refs/tags/v1.15.5
  • refs/tags/v1.15.6
  • refs/tags/v1.16.0
  • refs/tags/v1.17.0
  • refs/tags/v1.18.0
  • refs/tags/v1.18.1
  • refs/tags/v1.18.2
  • refs/tags/v1.19.0
  • refs/tags/v1.20.0
  • refs/tags/v1.20.1
  • refs/tags/v1.20.2
  • refs/tags/v1.20.3
  • refs/tags/v1.20.4
  • refs/tags/v1.20.5
  • refs/tags/v1.20.6
  • refs/tags/v1.20.7
  • refs/tags/v1.21.0
  • refs/tags/v1.22.0
  • refs/tags/v1.23.0
  • refs/tags/v1.23.1
  • refs/tags/v1.23.2
  • refs/tags/v1.24.0
  • refs/tags/v1.5.0
  • refs/tags/v1.5.4
  • refs/tags/v1.6.0
  • refs/tags/v1.6.1
  • refs/tags/v1.7.0
  • refs/tags/v1.8.0
  • refs/tags/v1.8.1
  • refs/tags/v1.8.2
  • refs/tags/v1.9.0
  • refs/tags/v1.9.1
  • refs/tags/v1.9.2
  • throttle
  • timeout-middleware
  • tollboth
  • v1.0.0
  • v1.1.0
  • v1.1.1
  • v1.1.2
  • v1.1.3
  • v1.1.4
  • v1.1.5
  • v1.1.6
  • v1.2.0
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.4.1

19 Aug 2026 01:26AM UTC coverage: 97.186% (+0.2%) from 96.939%
32204923861

push

github

web-flow
fix: order the gzip hijack error path so failures cannot corrupt the body (#56)

Closing the stream discarded its error and released the writer before the
hijack was attempted, which cost two things.

A failing Close means truncated gzip output, and a hijack succeeding right
after hid it. That error is returned now.

A failing Hijack left hijacked false with the writer already released, so a
handler carrying on would take the plain path and append raw bytes to a body
already advertised as Content-Encoding: gzip. The writer stays attached on that
path instead, and since it is closed a further write fails with "flate: closed
writer" rather than corrupting the response. The deferred close still returns it
to the pool, and the pool is safe because Reset clears the closed flag.

The writer is only released once Hijack has actually taken the connection.

Reported by umputun on #55.

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

1658 of 1706 relevant lines covered (97.19%)

47.3 hits per line

Relevant lines Covered
Build:
Build:
1706 RELEVANT LINES 1658 COVERED LINES
47.3 HITS PER LINE
Source Files on master
  • Tree
  • List 25
  • 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
32204923861 master fix: order the gzip hijack error path so failures cannot corrupt the body (#56) Closing the stream discarded its error and released the writer before the hijack was attempted, which cost two things. A failing Close means truncated gzip output, a... push 19 Aug 2026 01:26AM UTC web-flow github
97.19
32198708772 master fix: send the 101 status line before the connection is handed over WriteHeader only committed when a Content-Type was already set, so the plain upgrade sequence, 101 with no content type followed by Hijack, recorded the status and never forwarded... push 18 Aug 2026 11:48PM UTC umputun github
96.94
32198203704 master fix: measure request duration on the injectable clock Handler took its start time from nowFn but closed the measurement with time.Since, so the duration always came from the wall clock and no test could control it. TestBenchmarks_Handler therefor... push 18 Aug 2026 11:41PM UTC umputun github
97.61
32197883937 master Negotiate gzip on the response content type (#51) * fix: negotiate gzip on the response content type Previously the middleware picked compression from the request Content-Type, which a normal GET does not send, so it fell back to application/oct... push 18 Aug 2026 11:37PM UTC web-flow github
97.49
32197356726 master Reject wildcard CORS origin when credentials are enabled (#52) * fix!: reject wildcard CORS origin when credentials are enabled Previously, CORS(CorsAllowCredentials(true)) kept the default "*" origin list and reflected any request Origin back t... push 18 Aug 2026 11:29PM UTC web-flow github
97.45
32197043514 master Fix verified findings in middlewares and helpers (#49) * fix: serve metrics unrestricted when no ips defined Previously, Metrics() without arguments passed an empty list to matchSourceIP, which returns false for every request, so the middleware ... push 18 Aug 2026 11:25PM UTC web-flow github
97.44
32195022949 master Handle If-None-Match correctly in CacheControl (#50) * fix: handle If-None-Match correctly in CacheControl Previously the header was tested with strings.Contains against the whole raw value, and a match returned 304 for any method. That answered... push 18 Aug 2026 10:58PM UTC web-flow github
97.08
29966545475 master ci: test all packages on a go 1.24 + stable matrix bare `go test` only covered the root package, so logger and realip had no ci coverage at all. added `./...` to test and build. the go-version pin (1.23) was below the go.mod floor (1.24.0); repla... push 22 Jul 2026 11:35PM UTC umputun github
97.08
29944554643 master ci: make coveralls reporting non-blocking push 22 Jul 2026 05:57PM UTC umputun github
96.23
29562569289 master fix: collapse line breaks in logged url url.QueryUnescape surfaces control chars the encoded url hid, so a crafted query like `?q=%0A...` forged an extra log record on every request. Collapse with the existing lineBreaks replacer, same as the bod... push 17 Jul 2026 07:17AM UTC umputun github
96.21
See All Builds (332)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc