Repository navigation
Comparing changes
Open a pull request
base repository: labstack/echo
base: 87a5c22
head repository: labstack/echo
compare: 5786024
- 20 commits
- 53 files changed
- 10 contributors
Commits on May 2, 2026
-
refactor: use the built-in max/min to simplify the code
Signed-off-by: criciss <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 01b45be - Browse repository at this point
Copy the full SHA 01b45beView commit details -
Merge pull request #2966 from criciss/master
refactor: use the built-in max/min to simplify the code
Configuration menu - View commit details
-
Copy full SHA for 7d1fed0 - Browse repository at this point
Copy the full SHA 7d1fed0View commit details
Commits on May 11, 2026
-
refactor: replace Split in loops with more efficient SplitSeq (#2969)
* refactor: replace Split in loops with more efficient SplitSeq Signed-off-by: box4wangjing <[email protected]> * refactor: replace Split in loops with more efficient SplitSeq Signed-off-by: box4wangjing <[email protected]> --------- Signed-off-by: box4wangjing <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 46f2b8b - Browse repository at this point
Copy the full SHA 46f2b8bView commit details -
refactor: modernize code usage using gofix
Modernizes the codebase using the Go 1.26 gofix tool to adopt newer idioms and library features while maintaining compatibility with the current toolchain.
Configuration menu - View commit details
-
Copy full SHA for 03d9298 - Browse repository at this point
Copy the full SHA 03d9298View commit details -
Configuration menu - View commit details
-
Copy full SHA for d17c907 - Browse repository at this point
Copy the full SHA d17c907View commit details
Commits on May 21, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 98d99d5 - Browse repository at this point
Copy the full SHA 98d99d5View commit details
Commits on May 22, 2026
-
Configuration menu - View commit details
-
Copy full SHA for c08ea0f - Browse repository at this point
Copy the full SHA c08ea0fView commit details
Commits on May 28, 2026
-
fix(binder): MustUnixTime docs say time.Time, not time.Duration
The non-Must variants (UnixTime, UnixTimeMilli, UnixTimeNano) all say "binds parameter to time.Time variable", but the three Must* versions copy-pasted the Duration variant's docstring and say time.Duration. The function signature on each takes *time.Time. Also dropped the stray double space and fixed "nano second" -> "nanosecond" on the Nano one while in there. Signed-off-by: Charlie Tonneslan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dac56bc - Browse repository at this point
Copy the full SHA dac56bcView commit details
Commits on Jun 5, 2026
-
fix(middleware): correct documented KeyAuth KeyLookup default
DefaultKeyAuthConfig sets KeyLookup to "header:Authorization:Bearer " in v5, but the KeyAuthConfig.KeyLookup comment still shows the v4 default of "header:Authorization". Update the comment to match. Signed-off-by: leestana01 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 29727ff - Browse repository at this point
Copy the full SHA 29727ffView commit details
Commits on Jun 8, 2026
-
fix(middleware/proxy): append RealIP to X-Forwarded-For for WebSocket…
… requests (#2994) * <Description> The proxy middleware's WebSocket path currently sets `X-Forwarded-For` only when the header is empty, dropping the proxy's own peer IP from the chain whenever upstream proxies had already added entries. This breaks downstream services that rely on the "rightmost untrusted" rule to extract the real client IP, including echo's own `ExtractIPFromXFFHeader`. The HTTP path delegates to `net/http/httputil.ReverseProxy`, which appends `RemoteAddr` to the existing `X-Forwarded-For` chain — either inline in `ServeHTTP`'s default Director path ([reverseproxy.go#L519-L531](https://github.com/golang/go/blob/go1.26.3/src/net/http/httputil/reverseproxy.go#L519-L531)) or via the explicit [`(*ProxyRequest).SetXForwarded`](https://github.com/golang/go/blob/go1.26.3/src/net/http/httputil/reverseproxy.go#L82-L96) when a `Rewrite` callback is configured. The WebSocket path uses `proxyRaw`, which writes the request verbatim via `r.Write(out)`, so this middleware is the only place where the appending happens for WebSocket Upgrade requests. <Change> Replace the "set if empty" guard with always-append. Read values via map access to preserve multi-line `X-Forwarded-For` headers (RFC 9110 §5.3 allows combining them by joining values with commas). <Test> Added TestProxyWebSocketXForwardedFor exercising 4 cases: - no incoming X-Forwarded-For → only c.RealIP() - single-line single-entry → preserved + c.RealIP() at the tail - ingle-line comma-separated → preserved + c.RealIP() at the tail - multi-line headers (multiple X-Forwarded-For occurrences) → joined with , + c.RealIP() at the tail Each case captures the request header at WebSocket Upgrade time inside the upstream handler and asserts both the appended tail and the preserved prefix. <Backwards compatibility> The change is additive: existing entries are preserved and the proxy's own peer IP is added at the tail. Downstream readers using the standard "rightmost untrusted" rule (e.g. echo.ExtractIPFromXFFHeader) see no behavioral difference for chains where they already worked, and start returning the correct IP for chains where the proxy IP was previously dropped. <Background> We hit this in production with an Echo-based WebSocket reverse proxy fronting an internal service that uses echo.ExtractIPFromXFFHeader for IP-based authorization. Multi-hop deployments (customer proxy → our reverse proxy → backend) broke because the reverse proxy's egress IP was missing from the chain reaching the backend. * Set up upstream per test
Configuration menu - View commit details
-
Copy full SHA for 6a390cb - Browse repository at this point
Copy the full SHA 6a390cbView commit details
Commits on Jun 11, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 9c748c9 - Browse repository at this point
Copy the full SHA 9c748c9View commit details
Commits on Jun 13, 2026
-
docs: liveness signals in README + public ROADMAP (#3002)
* docs: add liveness signals to README and a public ROADMAP - Add dynamic latest-release and last-commit badges (can't go stale) - Add positioning vs net/http and an "actively maintained" note - Add ROADMAP.md with version policy (v5 current, v4 LTS to 2026-12-31) and surface it from the README Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * docs: fix review findings in README/ROADMAP - Correct net/http interop claim: Echo handlers are not http.Handler; interop is via WrapHandler/WrapMiddleware - Clarify binding ships with a pluggable validator (not built-in validation) - ROADMAP: reference canonical auto-HEAD issue/PR (#2895/#2949) instead of the duplicate PRs (#2944/#2937) slated for closure Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b0a3916 - Browse repository at this point
Copy the full SHA b0a3916View commit details -
test: lock in v5 group route method-handling (405 + OPTIONS) (#3003)
* test: guard group catch-all against 405-masking and route shadowing Adds regression tests around automatic group catch-all (404) route registration. v5 removed that auto-registration; if it is restored (e.g. PR #2996) these tests ensure it does not bring back the issues that motivated the removal: - wrong HTTP method on an existing group route must still return 405 (with Allow header), not be masked to 404 by the catch-all; - the group catch-all must not shadow concrete sibling routes, root routes, or other sibling groups' routes. All four pass on current master (v5). The 405 test fails against the restore-v4-behavior approach in #2996, pinning down that tradeoff. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test: rewrite group method-handling tests after review Addresses review of the original regression file (PR #3003): its comments described an automatic group catch-all "triggered by middleware" that does not exist on master (v5), so the tests passed for the wrong reason and the no-op middleware was inert. Rewrite to assert v5's actual, verified behavior: - method mismatch on a group route -> 405 with full Allow header - OPTIONS on a registered group route -> 204 with Allow (preflight-relevant) - concrete routes resolve; group prefix does not affect root routes The 405 and OPTIONS tests are real gates: a group-level catch-all (manual or the auto-registration proposed in #2996) masks both as 404, which these tests would then catch. Drops the false premise, the inert middleware, and the in-comment PR reference. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test: add rewritten group method-handling tests The previous commit recorded only the deletion of the old file; this adds the rewritten suite (group_method_handling_test.go). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test: add companion test demonstrating group catch-all masking Addresses final review: converts the "verified empirically" comment into an actual test. TestGroupRoute_catchAllMasksMethodHandling registers a group-wide catch-all and asserts it masks both the 405 method-mismatch and the automatic OPTIONS (204) response as 404 — the regression the 405/OPTIONS gate tests guard against. Makes the rationale self-proving in-repo. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4f5ac60 - Browse repository at this point
Copy the full SHA 4f5ac60View commit details -
fix(binder): serialize BindingError to structured JSON (#2771) (#3004)
* fix(binder): serialize BindingError to structured JSON (#2771) BindingError embeds *HTTPError but did not implement json.Marshaler, so DefaultHTTPErrorHandler's type switch fell through to its default branch (the value is a *BindingError, not a *HTTPError), flattening responses to {"message":"Bad Request"} and dropping both the field name and the binder message — a regression from fbfe216. Implement MarshalJSON on *BindingError so it takes the handler's json.Marshaler branch, restoring the structured {"field":...,"message":...} response (the v4.10.2 behavior). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * docs/test(binder): clarify BindingError JSON + cover empty-message fallback (#2771) - Note on the struct that serialization goes through MarshalJSON (the json tags are documentation only now). - Add a test for the empty-message -> status-text fallback branch. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dba8ff6 - Browse repository at this point
Copy the full SHA dba8ff6View commit details -
fix(binder): include field name in form/struct bind conversion errors (…
…#2629) (#3005) bindData had the field name (inputFieldName) in scope but returned bare conversion errors, so c.Bind() failures gave no indication of which field failed (e.g. "strconv.ParseInt: parsing \"10a\"..."). Wrap the conversion errors with the field name using %w so errors.Is/As still work. Matches the wrap proposed by the reporter in the issue thread. Existing tests that asserted the bare message are updated to the field-prefixed form. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ec9515a - Browse repository at this point
Copy the full SHA ec9515aView commit details -
fix(middleware/static): don't double-unescape request path (#2599) (#…
…3006) * fix(middleware/static): don't double-unescape request path (#2599) http.Request.URL.Path is already decoded by net/http, but the static middleware unescaped it again by default, so files whose names contain a percent sign were not downloadable ("/100%25.txt" -> "invalid URL escape"). Default pathUnescape to false; only the wildcard param from a group route (set explicitly below) may still be escaped and is handled by the existing DisablePathUnescaping toggle. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(static): add percent-encoded traversal-protection case (#2599) Companion test confirming that defaulting pathUnescape to false does not weaken traversal protection — single-, double-, and dot-encoded "../" all stay within the served root. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a9ede66 - Browse repository at this point
Copy the full SHA a9ede66View commit details
Commits on Jun 14, 2026
-
perf: optimize core hot paths (chain, context, binding, responses) (#…
…3008) Compile middleware chains once, zero-copy String/HTML/JSONP writes, reuse delayedStatusWriter + context store map, single-key QueryParam fast path, per-type bind metadata cache, precomputed HSTS header, pooled request-ID buffers. No public API changes. Also de-flakes TestStartConfig_WithListenerNetwork (ephemeral port).
Configuration menu - View commit details
-
Copy full SHA for b1d65e4 - Browse repository at this point
Copy the full SHA b1d65e4View commit details -
feat(middleware): optional RateLimiterStoreContext for response heade…
…rs (#2961) (#3007) * feat(middleware): optional RateLimiterStoreContext for response headers (#2961) Adds an optional RateLimiterStoreContext interface. When the configured store implements AllowContext(c, identifier), the rate limiter calls it instead of Allow, giving the store access to the request context so it can set response headers such as Retry-After / X-RateLimit-*. Fully backward compatible: stores implementing only Allow are unchanged. This is the optional-interface approach proposed by the maintainer in the issue thread; it does not alter the existing Allow interface or the built-in store. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * feat(middleware): set X-RateLimit-* / Retry-After from built-in store (#2961) Implements AllowContext on RateLimiterMemoryStore so the default store sets X-RateLimit-Limit, X-RateLimit-Remaining, and (on deny) Retry-After headers out of the box — mirroring the v4 PR #2985 by @leno23 on the v5 line. Allow() is refactored to share an internal allow() with AllowContext; the optional RateLimiterStoreContext interface (added earlier in this PR) routes the middleware to AllowContext when the store implements it. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c9477eb - Browse repository at this point
Copy the full SHA c9477ebView commit details -
fix(static): reject encoded path separators that bypass route-level m…
…iddleware (#3009) Fixes GHSA-vfp3-v2gw-7wfq. See PR #3009.
Configuration menu - View commit details
-
Copy full SHA for 8d1ae9d - Browse repository at this point
Copy the full SHA 8d1ae9dView commit details -
Release v5.2.0. Bumps version.go and adds the changelog entry.
Configuration menu - View commit details
-
Copy full SHA for 5786024 - Browse repository at this point
Copy the full SHA 5786024View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 87a5c22...5786024