commit 7ec2005964683f4ea5340b51f096eb99f37af709
parent 72320321465c1bf8564dd05524ff12742f4fe71b
Author: MichaĆ M. Sapka <michal@sapka.me>
Date: Thu, 13 Jul 2023 23:43:31 +0200
fix: clean headers before setting them
also, fix package name
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/go.mod b/go.mod
@@ -1,4 +1,4 @@
-module cvs.sapka.me/plaprox
+module vcs.sapka.me/plaprox
go 1.20
diff --git a/main.go b/main.go
@@ -73,6 +73,7 @@ func Proxy(w http.ResponseWriter, r *http.Request) {
req, _ := http.NewRequest(r.Method, "https://"+PlausibleHost+r.URL.Path, r.Body)
for key, values := range r.Header {
+ req.Header.Del(key)
for _, value := range values {
req.Header.Add(key, value)
}