File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,11 @@ func AuthMiddleware(next http.Handler) http.Handler {
103103 if authToken == token {
104104 success = true
105105
106- req .URL .Query ().Del ("@authorization" )
106+ modifiedQuery := req .URL .Query ()
107+
108+ modifiedQuery .Del ("@authorization" )
109+
110+ req .URL .RawQuery = modifiedQuery .Encode ()
107111 }
108112 }
109113
@@ -166,15 +170,21 @@ func TemplatingMiddleware(next http.Handler, VARIABLES map[string]string) http.H
166170 query , _ := renderTemplate ("query" , req .URL .RawQuery , VARIABLES )
167171
168172 queryData , _ := url .ParseQuery (query )
173+
174+ modifiedQuery := req .URL .Query ()
169175
170176 for key , value := range queryData {
171177 keyWithoutPrefix , found := strings .CutPrefix (key , "@" )
172178
173179 if found {
174180 modifiedBodyData [keyWithoutPrefix ] = value
181+
182+ modifiedQuery .Del (key )
175183 }
176184 }
177185
186+ req .URL .RawQuery = modifiedQuery .Encode ()
187+
178188 modifiedBodyBytes , err = json .Marshal (modifiedBodyData )
179189
180190 if err != nil {
You can’t perform that action at this time.
0 commit comments