|
@@ -25,6 +25,7 @@ import (
|
|
|
|
|
|
uuid "github.com/satori/go.uuid"
|
|
uuid "github.com/satori/go.uuid"
|
|
"imuslab.com/arozos/mod/auth"
|
|
"imuslab.com/arozos/mod/auth"
|
|
|
|
+ "imuslab.com/arozos/mod/common"
|
|
"imuslab.com/arozos/mod/database"
|
|
"imuslab.com/arozos/mod/database"
|
|
filesystem "imuslab.com/arozos/mod/filesystem"
|
|
filesystem "imuslab.com/arozos/mod/filesystem"
|
|
"imuslab.com/arozos/mod/user"
|
|
"imuslab.com/arozos/mod/user"
|
|
@@ -121,7 +122,7 @@ func (s *Manager) HandleShareAccess(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusUnauthorized)
|
|
w.WriteHeader(http.StatusUnauthorized)
|
|
w.Write([]byte("401 - Unauthorized"))
|
|
w.Write([]byte("401 - Unauthorized"))
|
|
} else {
|
|
} else {
|
|
- http.Redirect(w, r, "/login.system?redirect=/share?id="+id, 307)
|
|
|
|
|
|
+ http.Redirect(w, r, common.ConstructRelativePathFromRequestURL(r.RequestURI, "login.system")+"?redirect=/share?id="+id, 307)
|
|
}
|
|
}
|
|
return
|
|
return
|
|
} else {
|
|
} else {
|
|
@@ -134,7 +135,7 @@ func (s *Manager) HandleShareAccess(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusUnauthorized)
|
|
w.WriteHeader(http.StatusUnauthorized)
|
|
w.Write([]byte("401 - Unauthorized"))
|
|
w.Write([]byte("401 - Unauthorized"))
|
|
} else {
|
|
} else {
|
|
- http.Redirect(w, r, "/login.system?redirect=/share?id="+id, 307)
|
|
|
|
|
|
+ http.Redirect(w, r, common.ConstructRelativePathFromRequestURL(r.RequestURI, "login.system")+"?redirect=/share?id="+id, 307)
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -174,7 +175,7 @@ func (s *Manager) HandleShareAccess(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusUnauthorized)
|
|
w.WriteHeader(http.StatusUnauthorized)
|
|
w.Write([]byte("401 - Unauthorized"))
|
|
w.Write([]byte("401 - Unauthorized"))
|
|
} else {
|
|
} else {
|
|
- http.Redirect(w, r, "/login.system?redirect=/share?id="+id, 307)
|
|
|
|
|
|
+ http.Redirect(w, r, common.ConstructRelativePathFromRequestURL(r.RequestURI, "login.system")+"?redirect=/share?id="+id, 307)
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -200,7 +201,7 @@ func (s *Manager) HandleShareAccess(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusUnauthorized)
|
|
w.WriteHeader(http.StatusUnauthorized)
|
|
w.Write([]byte("401 - Unauthorized"))
|
|
w.Write([]byte("401 - Unauthorized"))
|
|
} else {
|
|
} else {
|
|
- http.Redirect(w, r, "/login.system?redirect=/share?id="+id, 307)
|
|
|
|
|
|
+ http.Redirect(w, r, common.ConstructRelativePathFromRequestURL(r.RequestURI, "login.system")+"?redirect=/share?id="+id, 307)
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|