You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "Kaustubh1204 (via GitHub)" <gi...@apache.org> on 2026/02/09 17:32:24 UTC

[PR] Fix #266: Remove duplicate redirect causing JSON unmarshal error on n… [kvrocks-controller]

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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org