1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-29 22:48:07 +02:00
Files
echo/response.go
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

3.5 KiB