Skip to content

Commit b93e634

Browse files
authored
fixed working with headers and cookies (#154)
1 parent 4a6414b commit b93e634

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

http.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func newRequest(ctx context.Context, log logger.Logger, addr string, req client.
8585
m = make(map[string]string)
8686
parameters["header"] = m
8787
}
88-
for idx := 0; idx < len(k)/2; idx += 2 {
88+
for idx := 0; idx+1 < len(k); idx += 2 {
8989
m[k[idx]] = k[idx+1]
9090
}
9191
}
@@ -98,7 +98,7 @@ func newRequest(ctx context.Context, log logger.Logger, addr string, req client.
9898
m = make(map[string]string)
9999
parameters["cookie"] = m
100100
}
101-
for idx := 0; idx < len(k)/2; idx += 2 {
101+
for idx := 0; idx+1 < len(k); idx += 2 {
102102
m[k[idx]] = k[idx+1]
103103
}
104104
}

0 commit comments

Comments
 (0)