|
|
|
@ -40,6 +40,7 @@ func isContainerPath(req *http.Request) bool {
|
|
|
|
|
var (
|
|
|
|
|
gitRawOrAttachPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/(?:(?:git-(?:(?:upload)|(?:receive))-pack$)|(?:info/refs$)|(?:HEAD$)|(?:objects/)|(?:raw/)|(?:releases/download/)|(?:attachments/))`)
|
|
|
|
|
lfsPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/info/lfs/`)
|
|
|
|
|
archivePathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/archive/`)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func isGitRawOrAttachPath(req *http.Request) bool {
|
|
|
|
@ -56,6 +57,10 @@ func isGitRawOrAttachOrLFSPath(req *http.Request) bool {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func isArchivePath(req *http.Request) bool {
|
|
|
|
|
return archivePathRe.MatchString(req.URL.Path)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// handleSignIn clears existing session variables and stores new ones for the specified user object
|
|
|
|
|
func handleSignIn(resp http.ResponseWriter, req *http.Request, sess SessionStore, user *user_model.User) {
|
|
|
|
|
// We need to regenerate the session...
|
|
|
|
|