fixed auth check

thats why we test
This commit is contained in:
Djeeberjr 2022-06-03 19:56:07 +02:00
parent 339dbe617f
commit 3de0aaeec8

View File

@ -193,13 +193,13 @@ func getShareHead(client *client.Client, w http.ResponseWriter, r *http.Request)
} }
func checkAuth(w http.ResponseWriter, r *http.Request, username, password string) bool { func checkAuth(w http.ResponseWriter, r *http.Request, username, password string) bool {
username, password, ok := r.BasicAuth() authUsername, authPassword, ok := r.BasicAuth()
if !ok { if !ok {
w.WriteHeader(http.StatusUnauthorized) w.WriteHeader(http.StatusUnauthorized)
return false return false
} }
if username != username || password != password { if username != authUsername || password != authPassword {
w.WriteHeader(http.StatusUnauthorized) w.WriteHeader(http.StatusUnauthorized)
return false return false
} }