Kaustubh1204 opened a new pull request, #378: URL: https://github.com/apache/kvrocks-controller/pull/378
## Problem Issue #266: `kvctl` commands fail with "unexpected end of JSON input" when connecting to non-loopback IP addresses via `-H` flag. ## Root Cause Duplicate `c.Redirect()` calls in [RedirectIfNotLeader](cci:1://file:///c:/Users/kingk/Desktop/gsoc/apache/%23266/kvrocks-controller/server/middleware/middleware.go:62:0-85:1) middleware (lines 78-79): - Line 78: Correctly redirects using extracted peer address ✓ - Line 79: Immediately overwrites with raw session ID ✗ This creates an invalid redirect URL causing empty/malformed responses. ## Solution Remove the duplicate second redirect call (line 79). ## Changes - 1 line removed from [server/middleware/middleware.go](cci:7://file:///c:/Users/kingk/Desktop/gsoc/apache/%23266/kvrocks-controller/server/middleware/middleware.go:0:0-0:0) - Minimal, focused fix with no other code changes Fixes #266 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
