Skip to content

Commit 79f5957

Browse files
committed
feat: support parsing query params for POST requests
Signed-off-by: arkbriar <[email protected]>
1 parent 08acdfe commit 79f5957

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func init() {
3434
flag.StringVar(&upstreamTLSCertDir, "upstream-tls-cert-dir", "", "directory to load certificates from")
3535
flag.StringVar(&labelMatchers, "label-matchers", "", "label matchers to apply to all queries")
3636
flag.BoolVar(&printAccessLog, "print-access-log", false, "print access log")
37-
flag.StringVar(&isolationKeys, "isolation-keys", "namespace", "keys to isolate on, separated by commas")
37+
flag.StringVar(&isolationKeys, "isolation-keys", "", "keys to isolate on, separated by commas")
3838
}
3939

4040
func newProxy() (*proxy.Proxy, error) {

pkg/proxy/handler.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package proxy
33
import (
44
"context"
55
"io"
6+
"maps"
67
"net/http"
78
"net/url"
89
"strings"
@@ -50,7 +51,9 @@ func (h *handler) getValuesFromRequest(r *http.Request) url.Values {
5051
if err := r.ParseForm(); err != nil {
5152
return nil
5253
}
53-
return r.PostForm
54+
v := r.URL.Query()
55+
maps.Insert(v, maps.All(r.PostForm))
56+
return v
5457
}
5558
return nil
5659
}

0 commit comments

Comments
 (0)