1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-27 22:38:25 +02:00
Commit Graph

10 Commits

Author SHA1 Message Date
kumapower17
e644ff8f7b Replace custom private IP range check with built-in net.IP.IsPrivate() method 2025-10-15 21:46:24 +03:00
Vishal Rana
a92f4209c6 Fix IP extraction fallback and improve Response.Flush error messages
Fixes two issues:

1. extractIP now handles RemoteAddr without port (#2757)
   - Previously returned empty string for addresses like "192.168.1.1"
   - Now validates with net.ParseIP and returns the IP directly
   - Maintains full backwards compatibility for existing behavior

2. Response.Flush uses modern error handling (#2789)
   - Replaces type assertion with http.NewResponseController
   - Provides descriptive panic message with ResponseWriter type info
   - Improves debugging experience when flushing is not supported

Both changes maintain full backwards compatibility while fixing edge cases.

Closes #2757
Closes #2789

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-15 17:52:30 -07:00
zhuhaicity
ce0b12ae53 chore: fix some typos in comment (#2735)
Signed-off-by: zhuhaicity <zhuhai@52it.net>
2025-01-12 09:28:38 +02:00
Behnam
f7d9f5142e optimization: struct alignment (#2636)
(#2632)
2024-05-30 22:50:01 +03:00
Vladimir Buyanov
a3b0ba24d3 Fix Real IP logic (#2550)
* Fix realIP logic
2024-03-10 19:04:54 +02:00
Martti T
a842444e8f Add SPDX licence comments to files. See https://spdx.dev/learn/handling-license-info/ (#2604) 2024-03-09 11:21:24 +02:00
teslaedison
34717b717d fix some typos (#2603)
Signed-off-by: teslaedison <qingchengqiushuang@gmail.com>
2024-03-06 21:43:59 +02:00
Wim
7544796946 Remove square brackets from ipv6 addresses in XFF (#2182)
Remove square brackets from ipv6 addresses in XFF
2022-11-24 22:17:31 +02:00
Yusuf Eyisan
124825ee62 Bugfix/1834 Fix X-Real-IP bug (#2007)
* Fix incorrect return ip value for RealIpHeader
* Improve test file to compare correct real IPs to each other and have better comments
* Refactor ip extractor tests to be more readable (longer but readable)

Co-authored-by: toimtoimtoim <desinformatsioon@gmail.com>
2022-03-01 08:56:46 +01:00
Shinichi TAMURA
7c5af01350 Safer/trustable extraction of real ip from request (#1478)
* Safer/trustable extraction of real ip from request

* Fix x-real-ip handling on proxy

* fix docs

* fix default check
2020-02-24 08:29:34 -08:00