Repository navigation
Releases
Releases · poli-page/gin
v0.13.1
Fixes PDFStream on Gin v1.11 and later, and on HTTP/2. The Gin floor rises to v1.12.0; the module stays on 0.13, the API's major.minor, so this ships as a patch.
Added
- A documentation site at https://poli-page.github.io/gin/, built from
docs/and deployed by the new Docs workflow. It replaces the six pages that were indocs/*.md, and the README links to the site. - CodeQL workflow, and coverage uploaded to Codecov from CI.
- The README badge row, as on
poli-page/sdk-goand with a Gin chip.
Changed
go.modrequires Ginv1.12.0(wasv1.10.0).- The Release workflow creates the GitHub Release for the pushed tag, with the
CHANGELOG.mdsection as its notes, once its version checks pass. - CI runs the suite on Gin
v1.11.0andv1.12.0too, next tov1.9.1andv1.10.0. Coverage is uploaded from thev1.12.0leg only.
Fixed
PDFStream: a failure after the first chunk ended as a short200that looks complete in two cases: on Gin v1.11 and later behind a writer wrapper withoutUnwrap(such asgin-contrib/gzip), because Gin'sHijacknow refuses once body bytes are written; and over HTTP/2 behindgin.Recovery(). The helper no longer hijacks: it sets a write deadline in the past on the server's own writer, found throughUnwrapand through the writer a wrapper embeds. The client seesunexpected EOFon HTTP/1.x and a stream reset on HTTP/2, behindgin.Recovery()too, andnet/httpno longer logsresponse.Write on hijacked connection.
v0.13.0
Requires github.com/poli-page/sdk-go 0.13 and passes the Poli Page API contract v0.13.0. The module now shares its major.minor with the Poli Page API, so it moves from 0.11 to 0.13; there was no 0.12 (see CONTRIBUTING.md).
Added
- Release checks:
scripts/check-release-versions.sh vX.Y.Zfails unless the version's major.minor is the pinned API contract's (a stable contract tag on the commit.github/workflows/ci.ymlpins, never the comment next to it) and thegithub.com/poli-page/sdk-gominor thatgo.modandexample-app/go.modrequire (neither mayreplaceit); the error names both versions. Run it before pushing a tag; the new Release workflow re-runs it, with a check of theCHANGELOGsection, on every pushedv*tag. CONTRIBUTING.md: a "Versions" section on how the module's versions follow the API's.
Changed
- Breaking: requires
github.com/poli-page/sdk-gov0.13.0in bothgo.modfiles. Ago.modrequirement is a minimum, so keep the SDK on0.13.xwhile you use0.13.xof this module. With it:- a
2xxfrom the API whose body is not JSON (usually from a proxy or a captive portal) isinvalid_response(wasINTERNAL_ERRORwith the2xxas its status). The error handler,ErrorMiddlewareandWriteErroranswer it502with the SDK'sToPayload()as is,{"code": "invalid_response", "message": "Invalid response: HTTP 200 body is not JSON", "status": 502, "requestId": ...}; with SDK 0.11 they answered the2xxitself with an error body.polipage-renderexits4for it. polipage.RenderToFilewrite failures areio_error(wasio_failed), with no status: the error handler answers them500with"status": null.- the PDF download of
Render.PDFandRender.PDFStreamis bounded by the client's timeout (POLI_PAGE_TIMEOUT,Config.Timeout): the whole download forRender.PDF, each read forRender.PDFStream.
- a
- CI pins the API contract v0.13.0 (was the commit tagged v0.12.0, once named v1.3.0) and runs its integration cases, including
impl.invalid-response, against the example app; all six pass and none is skipped. - The live API CI job passes the optional
POLI_PAGE_BASE_URLsecret to the integration test and the CLI smoke test (unset: the SDK default), next to thepp_sandbox_key inPOLI_PAGE_API_KEY. The integration test passesPOLI_PAGE_BASE_URLto the client when it is set. - Dependency floors of the module:
golang.org/x/netv0.58.0(wasv0.25.0),golang.org/x/textv0.41.0(wasv0.15.0),golang.org/x/cryptov0.55.0andgolang.org/x/sysv0.47.0, which fix every vulnerability govulncheck reports as reachable from this module with Ginv1.10.0, except four HTTP/2 server ones fixed only inx/netv0.60.0, which needs Go 1.26.github.com/stretchr/testifyv1.12.1(wasv1.10.0). The minimum Go stays 1.25 (go 1.25.0), and so does the Gin floor (v1.10.0). - Example app: Gin
v1.12.0andgithub.com/stretchr/testifyv1.12.1.