Skip to content

fix(deps): update module github.com/go-chi/chi/v5 to v5.3.2 - #12

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/github.com-go-chi-chi-v5-5.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/github.com-go-chi-chi-v5-5.x

Conversation

@renovate

@renovate renovate Bot commented Jun 28, 2025

Copy link
Copy Markdown

This PR contains the following updates:

Package Change Age Confidence
github.com/go-chi/chi/v5 v5.2.1v5.3.2 age confidence

Release Notes

go-chi/chi (github.com/go-chi/chi/v5)

v5.3.2

Compare Source

What's Changed

  • feat(middleware): add text/markdown, text/csv, text/vtt to default compressible types by @​VojtechVitek in #​1151
  • docs: deployment recipe for middleware.ClientIPFromXFFTrustedProxies() by @​VojtechVitek in #​1111
  • fix: don't drop handlers that collide with a Mount()/Route() pattern by @​VojtechVitek in #​1148
  • Don't duplicate methods in Allow: header for 405 responses by @​flimzy in #​1029
  • fix(middleware): reject catch-all compress wildcards by @​VojtechVitek in #​1156
    • middleware.NewCompressor(level, "/*") never worked and silently compressed nothing. Instead of turning it into a compress-everything catch-all (as proposed in #​868 and #​1121), we decided to reject both "/" and "/*" at construction and panic. Compressing every response wastes CPU on already-compressed types (zip, jpeg, png), which is why the middleware keeps a curated default list. Users should pass explicit content types.

Full Changelog: go-chi/chi@v5.3.1...v5.3.2

v5.3.1

Compare Source

What's Changed

New Contributors

Full Changelog: go-chi/chi@v5.3.0...v5.3.1

v5.3.0

Compare Source

What's Changed

New Contributors

SECURITY: middleware.ClientIP, a replacement for middleware.RealIP

PR #​967 introduced middleware.ClientIP, a replacement for middleware.RealIP that closes the three open spoofing advisories:

It also addresses issues outlined at:

middleware.RealIP is deprecated in this PR with pointers to the new API.

The deprecation only adds a // Deprecated: doc comment; the function keeps working for backward compatibility.

Why a new middleware (not "fix RealIP in place")

RealIP has two unfixable design choices: it mutates r.RemoteAddr, and it tries to be a one-size-fits-all default by walking a hard-coded list of headers any client can supply. Per adam-p's "The perils of the 'real' client IP" (which calls chi out by name on this), there is no safe default — the user must pick their trust source explicitly.

The new API

Four middlewares, two accessors. Pick exactly one middleware based on your
infrastructure, read the result with one of the two accessors:

// One of the four. There is no safe default — pick exactly one.
func ClientIPFromHeader(trustedHeader string) func(http.Handler) http.Handler
func ClientIPFromXFF(trustedIPPrefixes ...string) func(http.Handler) http.Handler
func ClientIPFromXFFTrustedProxies(numTrustedProxies int) func(http.Handler) http.Handler
func ClientIPFromRemoteAddr(h http.Handler) http.Handler

// Read the result.
func GetClientIP(ctx context.Context) string         // for logs, rate-limit keys
func GetClientIPAddr(ctx context.Context) netip.Addr // for typed work

Example usage:

// Pick a single ClientIP middleware based on your deployment
  
// Cloudflare.
r.Use(middleware.ClientIPFromHeader("CF-Connecting-IP"))

// Nginx with ngx_http_realip_module.
r.Use(middleware.ClientIPFromHeader("X-Real-IP"))

// Apache with mod_remoteip.
r.Use(middleware.ClientIPFromHeader("X-Client-IP"))

// AWS CloudFront, or any proxy fleet with known CIDRs.
r.Use(middleware.ClientIPFromXFF(
    "13.32.0.0/15",   // CloudFront IPv4
    "52.46.0.0/18",   // CloudFront IPv4
    "2600:9000::/28", // CloudFront IPv6
))

// Behind exactly 2 trusted proxies with dynamic IPs (autoscaling pools,
// ephemeral containers, dynamic CDN edges).
r.Use(middleware.ClientIPFromXFFTrustedProxies(2))

// Server directly on the public internet, no proxy in front.
r.Use(middleware.ClientIPFromRemoteAddr)

And in your handler or downstream middleware:

clientIP := middleware.GetClientIP(r.Context())
// log it, use it as a rate-limit key, etc.

Thanks to @​adam-p, @​c2h5oh, @​rezmoss, @​Saku0512, @​convto, @​Dirbaio, @​jawnsy, @​lrstanley, @​mfridman, @​n33pm, @​pkieltyka for the prior discussions, detailed reviews, advisory reports, and test contributions that shaped this PR.

Full Changelog: go-chi/chi@v5.2.5...v5.3.0

v5.2.5

Compare Source

What's Changed

New Contributors

Full Changelog: go-chi/chi@v5.2.3...v5.2.5

v5.2.4

Compare Source

v5.2.3

Compare Source

What's Changed

New Contributors

Full Changelog: go-chi/chi@v5.2.2...v5.2.3

v5.2.2

Compare Source

What's Changed

Security fix

  • Fixes GHSA-vrw8-fxc6-2r93 - "Host Header Injection Leads to Open Redirect in RedirectSlashes" commit
    • a lower-severity Open Redirect that can't be exploited in browser or email client, as it requires manipulation of a Host header
    • reported by Anuraag Baishya, @​anuraagbaishya. Thank you!

New Contributors

Full Changelog: go-chi/chi@v5.2.1...v5.2.2


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot changed the title fix(deps): update module github.com/go-chi/chi/v5 to v5.2.2 fix(deps): update module github.com/go-chi/chi/v5 to v5.2.3 Sep 1, 2025
@renovate
renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 8303139 to 2aa87a4 Compare September 1, 2025 10:29
@renovate
renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 2aa87a4 to 1fb357a Compare September 26, 2025 03:51
@renovate renovate Bot changed the title fix(deps): update module github.com/go-chi/chi/v5 to v5.2.3 fix(deps): update module github.com/go-chi/chi/v5 to v5.2.4 Jan 15, 2026
@renovate
renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 1fb357a to 0295079 Compare January 15, 2026 08:03
@renovate renovate Bot changed the title fix(deps): update module github.com/go-chi/chi/v5 to v5.2.4 fix(deps): update module github.com/go-chi/chi/v5 to v5.2.5 Feb 6, 2026
@renovate
renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 0295079 to 97a56e6 Compare February 6, 2026 08:05
@renovate renovate Bot changed the title fix(deps): update module github.com/go-chi/chi/v5 to v5.2.5 fix(deps): update module github.com/go-chi/chi/v5 to v5.3.0 May 23, 2026
@renovate
renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 97a56e6 to e1d52ad Compare May 23, 2026 15:25
@renovate renovate Bot changed the title fix(deps): update module github.com/go-chi/chi/v5 to v5.3.0 fix(deps): update module github.com/go-chi/chi/v5 to v5.3.1 Jul 9, 2026
@renovate
renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from e1d52ad to df7f60b Compare July 9, 2026 04:05
@renovate
renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from df7f60b to de9b62c Compare August 21, 2026 23:54
@renovate renovate Bot changed the title fix(deps): update module github.com/go-chi/chi/v5 to v5.3.1 fix(deps): update module github.com/go-chi/chi/v5 to v5.3.2 Aug 21, 2026
@renovate renovate Bot changed the title fix(deps): update module github.com/go-chi/chi/v5 to v5.3.2 fix(deps): update module github.com/go-chi/chi/v5 to v5.3.2 - autoclosed Aug 29, 2026
@renovate renovate Bot closed this Aug 29, 2026
@renovate
renovate Bot deleted the renovate/github.com-go-chi-chi-v5-5.x branch August 29, 2026 05:29
@renovate renovate Bot changed the title fix(deps): update module github.com/go-chi/chi/v5 to v5.3.2 - autoclosed fix(deps): update module github.com/go-chi/chi/v5 to v5.3.2 Sep 1, 2026
@renovate renovate Bot reopened this Sep 1, 2026
@renovate
renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from de9b62c to 2178a9a Compare September 1, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants