mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: avoid redirect loop on workspace proxies (#9389)
* fix: avoid redirect loop on workspace proxies --------- Co-authored-by: Steven Masley <stevenmasley@coder.com>
This commit is contained in:
co-authored by
Steven Masley
parent
eb68684327
commit
5993f85ec9
@@ -220,8 +220,12 @@ func (s *Server) handleAPIKeySmuggling(rw http.ResponseWriter, r *http.Request,
|
||||
// We don't set an expiration because the key in the database already has an
|
||||
// expiration, and expired tokens don't affect the user experience (they get
|
||||
// auto-redirected to re-smuggle the API key).
|
||||
//
|
||||
// We use different cookie names for path apps and for subdomain apps to
|
||||
// avoid both being set and sent to the server at the same time and the
|
||||
// server using the wrong value.
|
||||
http.SetCookie(rw, &http.Cookie{
|
||||
Name: codersdk.DevURLSessionTokenCookie,
|
||||
Name: AppConnectSessionTokenCookieName(accessMethod),
|
||||
Value: token,
|
||||
Domain: domain,
|
||||
Path: "/",
|
||||
|
||||
Reference in New Issue
Block a user