Skip to content

Commit

Permalink
Replaced domains in cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
evg4b committed Jan 4, 2024
1 parent 746dcbc commit 794a148
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/handler/proxy/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (h *Handler) executeQuery(request *http.Request) (*http.Response, error) {
func copyCookiesToSource(target *http.Response, replacer *urlreplacer.Replacer, source http.ResponseWriter) error {
for _, cookie := range target.Cookies() {
cookie.Secure = replacer.IsTargetSecure()
// TODO: Replace domain in cookie
cookie.Domain = replacer.ReplaceSoft(cookie.Domain)
http.SetCookie(source, cookie)
}

Expand All @@ -88,7 +88,7 @@ func copyCookiesToSource(target *http.Response, replacer *urlreplacer.Replacer,
func copyCookiesToTarget(source *http.Request, replacer *urlreplacer.Replacer, target *http.Request) error {
for _, cookie := range source.Cookies() {
cookie.Secure = replacer.IsTargetSecure()
// TODO: Replace domain in cookie
cookie.Domain = replacer.ReplaceSoft(cookie.Domain)
target.AddCookie(cookie)
}

Expand Down

0 comments on commit 794a148

Please sign in to comment.