Skip to content

Commit 89dd44e

Browse files
committed
Fix bug in reverse proxy
Unfortunately go panics you try to cast a nil interface{} as another primitive therefore you need to check interfaces are not nil before casting. Fix #16025 Signed-off-by: Andrew Thornton <[email protected]>
1 parent effad26 commit 89dd44e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/auth/sso/reverseproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (r *ReverseProxy) VerifyAuthData(req *http.Request, w http.ResponseWriter,
7979

8080
// Make sure requests to API paths, attachment downloads, git and LFS do not create a new session
8181
if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitRawOrLFSPath(req) {
82-
if sess.Get("uid").(int64) != user.ID {
82+
if sess != nil && (sess.Get("uid") == nil || sess.Get("uid").(int64) != user.ID) {
8383
handleSignIn(w, req, sess, user)
8484
}
8585
}

0 commit comments

Comments
 (0)