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

go-pkgz / rest
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: refs/tags/v1.24.0
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 refs/tags/v1.24.0
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • 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
  • master
  • 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%
32208996131

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.33 hits per line

Relevant lines Covered
Build:
Build:
1706 RELEVANT LINES 1658 COVERED LINES
47.33 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
32208996131 refs/tags/v1.24.0 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 02:34AM UTC web-flow github
97.19
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
32201953393 fix/gzip-hijack-error-path fix: order the gzip hijack error path so failures cannot corrupt the body 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 h... Pull #56 19 Aug 2026 12:38AM UTC paskal 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
32198654843 fix/gzip-writer-capabilities 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... Pull #55 18 Aug 2026 11:48PM UTC paskal github
96.94
32198263088 fix/gzip-writer-capabilities fix: advertise Flusher and Hijacker only when the writer beneath does The wrapper implemented both unconditionally, so a handler's type assertion succeeded even when the writer underneath supported neither, and the Flush that followed silently di... Pull #55 18 Aug 2026 11:42PM UTC paskal github
96.93
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
32197939154 fix/benchmarks-deterministic-timing 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... Pull #54 18 Aug 2026 11:37PM UTC paskal github
97.45
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
32197728184 fix/gzip-response-negotiation fix: treat 101 as final, skip 205, and don't sniff an encoded body 101 was caught by the interim 1xx passthrough, so the deferred close could append gzip bytes after the connection had been handed to another protocol. It counts as final now, and ... Pull #51 18 Aug 2026 11:34PM UTC paskal github
97.49
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