diff --git a/proxyd/backend.go b/proxyd/backend.go
index cd5797927e8ae565036f34e23fd6a6091c7cedf5..a452a22f95fa3b70f30b62463229244481764e79 100644
--- a/proxyd/backend.go
+++ b/proxyd/backend.go
@@ -1170,6 +1170,6 @@ func RecordBatchRPCForward(ctx context.Context, backendName string, reqs []*RPCR
 }
 
 func stripXFF(xff string) string {
-	ipList := strings.Split(xff, ", ")
+	ipList := strings.Split(xff, ",")
 	return strings.TrimSpace(ipList[0])
 }
diff --git a/proxyd/backend_test.go b/proxyd/backend_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..7be23bfed7bc563174d4b7084bdb70a6b4d1c7db
--- /dev/null
+++ b/proxyd/backend_test.go
@@ -0,0 +1,21 @@
+package proxyd
+
+import (
+	"github.com/stretchr/testify/assert"
+	"testing"
+)
+
+func TestStripXFF(t *testing.T) {
+	tests := []struct {
+		in, out string
+	}{
+		{"1.2.3, 4.5.6, 7.8.9", "1.2.3"},
+		{"1.2.3,4.5.6", "1.2.3"},
+		{" 1.2.3 , 4.5.6 ", "1.2.3"},
+	}
+
+	for _, test := range tests {
+		actual := stripXFF(test.in)
+		assert.Equal(t, test.out, actual)
+	}
+}