parent
c623792c2f
commit
af240639cb
|
|
@ -170,6 +170,21 @@ func (s *Server) doAuthelia(foo http.HandlerFunc) http.HandlerFunc {
|
|||
)
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode == http.StatusOK {
|
||||
for k := range resp.Header {
|
||||
if strings.HasPrefix(k, "Remote-") {
|
||||
cookie := &http.Cookie{
|
||||
Name: k,
|
||||
Value: resp.Header.Get(k),
|
||||
Path: "/",
|
||||
Domain: r2.Host,
|
||||
SameSite: http.SameSiteLaxMode,
|
||||
Secure: true,
|
||||
HttpOnly: true,
|
||||
Expires: time.Now().Add(24 * time.Hour * 30),
|
||||
}
|
||||
http.SetCookie(w, cookie)
|
||||
}
|
||||
}
|
||||
foo(w, r)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue