Skip to content

Releases

v0.13.1

Choose a tag to compare

@github-actions github-actions released this 05 Nov 08:20
64342fc

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 in docs/*.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-go and with a Gin chip.

Changed

  • go.mod requires Gin v1.12.0 (was v1.10.0).
  • The Release workflow creates the GitHub Release for the pushed tag, with the CHANGELOG.md section as its notes, once its version checks pass.
  • CI runs the suite on Gin v1.11.0 and v1.12.0 too, next to v1.9.1 and v1.10.0. Coverage is uploaded from the v1.12.0 leg only.

Fixed

  • PDFStream: a failure after the first chunk ended as a short 200 that looks complete in two cases: on Gin v1.11 and later behind a writer wrapper without Unwrap (such as gin-contrib/gzip), because Gin's Hijack now refuses once body bytes are written; and over HTTP/2 behind gin.Recovery(). The helper no longer hijacks: it sets a write deadline in the past on the server's own writer, found through Unwrap and through the writer a wrapper embeds. The client sees unexpected EOF on HTTP/1.x and a stream reset on HTTP/2, behind gin.Recovery() too, and net/http no longer logs response.Write on hijacked connection.

v0.13.0

Choose a tag to compare

@Mickael45 Mickael45 released this 05 Nov 07:51
2034d51

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.Z fails unless the version's major.minor is the pinned API contract's (a stable contract tag on the commit .github/workflows/ci.yml pins, never the comment next to it) and the github.com/poli-page/sdk-go minor that go.mod and example-app/go.mod require (neither may replace it); the error names both versions. Run it before pushing a tag; the new Release workflow re-runs it, with a check of the CHANGELOG section, on every pushed v* tag.
  • CONTRIBUTING.md: a "Versions" section on how the module's versions follow the API's.

Changed

  • Breaking: requires github.com/poli-page/sdk-go v0.13.0 in both go.mod files. A go.mod requirement is a minimum, so keep the SDK on 0.13.x while you use 0.13.x of this module. With it:
    • a 2xx from the API whose body is not JSON (usually from a proxy or a captive portal) is invalid_response (was INTERNAL_ERROR with the 2xx as its status). The error handler, ErrorMiddleware and WriteError answer it 502 with the SDK's ToPayload() as is, {"code": "invalid_response", "message": "Invalid response: HTTP 200 body is not JSON", "status": 502, "requestId": ...}; with SDK 0.11 they answered the 2xx itself with an error body. polipage-render exits 4 for it.
    • polipage.RenderToFile write failures are io_error (was io_failed), with no status: the error handler answers them 500 with "status": null.
    • the PDF download of Render.PDF and Render.PDFStream is bounded by the client's timeout (POLI_PAGE_TIMEOUT, Config.Timeout): the whole download for Render.PDF, each read for Render.PDFStream.
  • 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_URL secret to the integration test and the CLI smoke test (unset: the SDK default), next to the pp_sandbox_ key in POLI_PAGE_API_KEY. The integration test passes POLI_PAGE_BASE_URL to the client when it is set.
  • Dependency floors of the module: golang.org/x/net v0.58.0 (was v0.25.0), golang.org/x/text v0.41.0 (was v0.15.0), golang.org/x/crypto v0.55.0 and golang.org/x/sys v0.47.0, which fix every vulnerability govulncheck reports as reachable from this module with Gin v1.10.0, except four HTTP/2 server ones fixed only in x/net v0.60.0, which needs Go 1.26. github.com/stretchr/testify v1.12.1 (was v1.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.0 and github.com/stretchr/testify v1.12.1.