fasthttp @ v1.80.0
integrity
- size
- 702.9 KiB
- downloaded
- last checked
- overlays
- go
- detected
- go module github.com/valyala/fasthttp
release notes
v1.80.0 fixes client connection desynchronization when skipping response bodies and preserves cache variation headers during compression. It also adds helper APIs for downstream frameworks, makes parser errors matchable, and improves redirects, compression negotiation, and repeated-header handling.
Security fixes and hardening
- Skipping a response body no longer desynchronizes later requests. Reusing a
Responseafter HEAD no longer makes subsequent requests skip their bodies. When a caller explicitly skips a potentially present body,ClientandHostClientclose the connection instead of pooling it with unread bytes.PipelineClientreads and discards the body so the next pipelined response starts at the correct boundary. The caller'sSkipBodysetting is preserved. #2533 - Compression preserves every
Varyline. AddingAccept-Encodingno longer removes laterVaryfields, such asVary: Cookie. This fixes a regression that could let a shared cache reuse a response without considering all of its original variation criteria. BothCompressHandlerand compressed static-file serving are covered. #2598 - Unsigned float parsing rejects non-finite values and negative zero.
ParseUfloatand the argument getters that use it now reject NaN, infinity, and-0. Finite formats accepted bystrconv.ParseFloat, including a leading+, digit separators, and hexadecimal floats, remain supported. #2546
Features
- Bounded decompression helpers work directly on byte slices.
AppendGunzipBytesWithLimit,AppendInflateBytesWithLimit,AppendUnbrotliBytesWithLimit, andAppendUnzstdBytesWithLimitappend decoded data while enforcing a limit on newly decoded bytes. Existing data in the destination does not count toward the limit. Exceeding the limit returnsErrBodyTooLarge; a non-positive limit leaves output unlimited. The zstd helper also limits decoder window size when a positive limit is supplied. #2520 - Frameworks can inspect header normalization and reuse redirect helpers.
RequestHeader.NormalizingDisabled()andResponseHeader.NormalizingDisabled()expose the current setting.HasNonHTTPSchemeWithoutAuthorityidentifies locations such asmailto:and native-app callbacks, andDefaultMaxRedirectsCountexports the existing default of 16.DoRedirectscontinues to use the count explicitly supplied by its caller. #2520 - Unsupported methods and unknown transfer codings have matchable errors.
errors.Iscan identifyErrUnsupportedRequestMethodregardless ofSecureErrorLogMessage. The newErrUnknownTransferCodingdistinguishes a well-formed but unsupported transfer coding from malformed framing and also matchesErrUnsupportedTransferEncoding. Custom error handlers can use these distinctions to choose between 501 and 400 responses; malformed request fields and targets still take precedence over an unknown coding. #2594
HTTP compatibility and redirects
- Compression negotiation checks all supplied encodings.
HasAcceptEncodingscans everyAccept-Encodingheader line and continues after a matchingq=0member, so a later acceptable occurrence is considered. Compressible media types are also recognized case-insensitively. #2600, #2590, #2606 - Directory redirects preserve the client-facing path. For ordinary origin-form request targets,
FSadds the trailing slash to the original encoded path and retains the query string. Prefix stripping and virtual-host rewriting no longer expose the internal filesystem lookup path in the redirect. #2551 DoRedirectspreserves URL credentials on the initial request. Relative redirects retain URI credentials, while absolute redirects use only their own userinfo. An explicitAuthorizationheader still takes precedence and follows the existing host-based forwarding rules. #2531- URI updates separate queries from fragments. Updating a URI with
?next=2#newnow storesnext=2as the query andnewas the fragment, keeping the fragment out of the HTTP request line. Explicit empty query delimiters are preserved, including a redirect target ending in?. Hosts with an empty port, such asexample.com:or[::1]:, now receive the scheme's default port when dialing. #2592, #2603 - Repeated cookies and suppressed content types retain their meaning.
ResponseHeader.PeekAll("Set-Cookie")returns each cookie separately instead of joining them into one value;Peekis unchanged. Adaptednet/httphandlers that setContent-Typeto nil or empty now send no default content type, on both buffered and flushed responses. #2599, #2556
This release also adds a WebSocket README, reorganizes its tests, addresses intermittent CI failures, and clarifies retry callback eligibility and fragmented input to Request.Read.
What's Changed
Security and hardening
- fix(client): don't let SkipBody desync reused responses and connections by @waw666waw666 in https://github.com/valyala/fasthttp/pull/2533
- fix: don't drop later Vary lines when adding Accept-Encoding by @waw666waw666 in https://github.com/valyala/fasthttp/pull/2598
- fix: reject NaN, infinity and negative zero in ParseUfloat by @Kernel-Hunter in https://github.com/valyala/fasthttp/pull/2546
Features
- feat: add helper APIs for downstream frameworks by @gaby in https://github.com/valyala/fasthttp/pull/2520
- feat: make the unsupported method and unknown transfer coding errors matchable by @gaby in https://github.com/valyala/fasthttp/pull/2594
Fixes
- fix(header): keep scanning Accept-Encoding after a q=0 member by @CJstate in https://github.com/valyala/fasthttp/pull/2590
- fix(fs): redirect a directory request to the path the client sent by @Dv2Corn in https://github.com/valyala/fasthttp/pull/2551
- fix: don't drop the URI userinfo in DoRedirects by @LuisFigueroaG in https://github.com/valyala/fasthttp/pull/2531
- fix(client): add the default port to a host with an empty port by @ruziba3vich in https://github.com/valyala/fasthttp/pull/2603
- fix(header): read every Accept-Encoding line in HasAcceptEncoding by @ruziba3vich in https://github.com/valyala/fasthttp/pull/2600
- fix: separate fragments in query-only URI updates by @anishpentyala in https://github.com/valyala/fasthttp/pull/2592
- fix(header): return each Set-Cookie value from ResponseHeader.PeekAll by @ruziba3vich in https://github.com/valyala/fasthttp/pull/2599
- fasthttpadaptor: send no Content-Type when the handler sets it to nil by @jaeminbird in https://github.com/valyala/fasthttp/pull/2556
- fix: recognize compressible media types case-insensitively by @Twiink in https://github.com/valyala/fasthttp/pull/2606
Documentation and tests
- websocket: sort the tests by file, tidy names and comments, add a README by @h2zi in https://github.com/valyala/fasthttp/pull/2558
- websocket: skip the tests that are flaky on Windows by @h2zi in https://github.com/valyala/fasthttp/pull/2587
- Fix five tests that fail intermittently in CI by @h2zi in https://github.com/valyala/fasthttp/pull/2589
- Fix typos in test comments by @ninglinLiu in https://github.com/valyala/fasthttp/pull/2596
- docs: clarify retry callback eligibility by @wozhenbang2004 in https://github.com/valyala/fasthttp/pull/2604
- docs: explain fragmented input to Request.Read by @wozhenbang2004 in https://github.com/valyala/fasthttp/pull/2605
Dependency updates
- chore(deps): bump golang.org/x/crypto from 0.58.0 to 0.59.0 by @dependabot[bot] in https://github.com/valyala/fasthttp/pull/2588
New Contributors
- @waw666waw666 made their first contribution in https://github.com/valyala/fasthttp/pull/2533
- @Kernel-Hunter made their first contribution in https://github.com/valyala/fasthttp/pull/2546
- @ninglinLiu made their first contribution in https://github.com/valyala/fasthttp/pull/2596
- @ruziba3vich made their first contribution in https://github.com/valyala/fasthttp/pull/2603
- @anishpentyala made their first contribution in https://github.com/valyala/fasthttp/pull/2592
- @wozhenbang2004 made their first contribution in https://github.com/valyala/fasthttp/pull/2604
- @Twiink made their first contribution in https://github.com/valyala/fasthttp/pull/2606
Full Changelog: https://github.com/valyala/fasthttp/compare/v1.79.0...v1.80.0
download
unix · zip
curl -fL -o v1.80.0.zip https://ratatoskr.space/pkg/fasthttp/v1.80.0.zip
printf '%s %s\n' '5a0f281510374ef3b465833537e90059e57f91a481dbf310fababccd7e366edb' 'v1.80.0.zip' | sha256sum -c -
windows · zip
$url = "https://ratatoskr.space/pkg/fasthttp/v1.80.0.zip"
$out = "v1.80.0.zip"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "5a0f281510374ef3b465833537e90059e57f91a481dbf310fababccd7e366edb") { throw "sha256 mismatch" }
unix · tar.gz
curl -fL -o v1.80.0.tar.gz https://ratatoskr.space/pkg/fasthttp/v1.80.0.tar.gz
printf '%s %s\n' '2c19f578bb83aeddfeb9888ab62db58b7afced8cbb6a87b8ab573f121a33b7c7' 'v1.80.0.tar.gz' | sha256sum -c -
windows · tar.gz
$url = "https://ratatoskr.space/pkg/fasthttp/v1.80.0.tar.gz"
$out = "v1.80.0.tar.gz"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "2c19f578bb83aeddfeb9888ab62db58b7afced8cbb6a87b8ab573f121a33b7c7") { throw "sha256 mismatch" }
download via yggdrasil mesh
unix · zip
curl -fL -o v1.80.0.zip http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/fasthttp/v1.80.0.zip
printf '%s %s\n' '5a0f281510374ef3b465833537e90059e57f91a481dbf310fababccd7e366edb' 'v1.80.0.zip' | sha256sum -c -
windows · zip
$url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/fasthttp/v1.80.0.zip"
$out = "v1.80.0.zip"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "5a0f281510374ef3b465833537e90059e57f91a481dbf310fababccd7e366edb") { throw "sha256 mismatch" }
unix · tar.gz
curl -fL -o v1.80.0.tar.gz http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/fasthttp/v1.80.0.tar.gz
printf '%s %s\n' '2c19f578bb83aeddfeb9888ab62db58b7afced8cbb6a87b8ab573f121a33b7c7' 'v1.80.0.tar.gz' | sha256sum -c -
windows · tar.gz
$url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/fasthttp/v1.80.0.tar.gz"
$out = "v1.80.0.tar.gz"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "2c19f578bb83aeddfeb9888ab62db58b7afced8cbb6a87b8ab573f121a33b7c7") { throw "sha256 mismatch" }
| artifact | format | size | hashes |
|---|---|---|---|
| v1.80.0.zip | zip | 711.4 KiB |
blake3-24 9e8ba0e90e48bf4404ea5e17331c1b2887c85817114b0707
sha256 5a0f281510374ef3b465833537e90059e57f91a481dbf310fababccd7e366edb
sha1 a0a6931b8b0f4c6223fdf4cbc0c436b0f6e78a2a
|
| v1.80.0.tar.gz | tar.gz | 616.0 KiB |
blake3-24 d81d000dad99cac3d00276e9d50171f99f46af9e437e9856
sha256 2c19f578bb83aeddfeb9888ab62db58b7afced8cbb6a87b8ab573f121a33b7c7
sha1 6555fa30f06aaef6543cbe21614df13121e4985a
|
go module archive
module zip with the module path rewritten to this mirror; fetched by go get through the
GOPROXY route
| artifact | format | size | hashes |
|---|---|---|---|
| v1.80.0.zip | zip | 716.4 KiB |
blake3-24 16281675c66bc3946887abf18898d70231bf1bd956fe36ec
sha256 1b51cf94300da252a95bf36dda30bfead4a206347317bc118675936aa0ef0aa9
sha1 8ac41e85cf7e30c5bfb0dc0bade696150d131e04
|
install
bazel
http_archive(
name = "fasthttp",
urls = ["https://ratatoskr.space/pkg/fasthttp/v1.80.0.tar.gz"],
integrity = "sha256-LBn1eLuDrt3+uYiKti21i3r87Yy7aoe4q1c/Ehozt8c=",
strip_prefix = "fasthttp-v1.80.0",
)
zig
.url = "https://ratatoskr.space/pkg/fasthttp/v1.80.0.tar.gz",
go
GOPROXY=https://ratatoskr.space GOSUMDB=off go get ratatoskr.space/pkg/fasthttp@v1.80.0
install via yggdrasil mesh
bazel
http_archive(
name = "fasthttp",
urls = ["http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/fasthttp/v1.80.0.tar.gz"],
integrity = "sha256-LBn1eLuDrt3+uYiKti21i3r87Yy7aoe4q1c/Ehozt8c=",
strip_prefix = "fasthttp-v1.80.0",
)
zig
.url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/fasthttp/v1.80.0.tar.gz",
go
GOPROXY=http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg GOSUMDB=off GOINSECURE=14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/* go get 14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/fasthttp@v1.80.0