-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove specific headers from request before sending to target
The code has been updated to remove specific headers from the request before sending it to the target. This is done by checking for query parameters with a specific prefix and removing the corresponding headers from the request. This change ensures that unwanted headers are not sent to the target server.
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package main | ||
|
||
import ( | ||
"net/url" | ||
"strings" | ||
) | ||
|
||
func getKeysByPrefix(query url.Values, prefix string) (keys []string) { | ||
for k, _ := range query { | ||
if strings.HasPrefix(k, prefix) { | ||
keys = append(keys, k) | ||
} | ||
} | ||
return | ||
} |