Skip to content

Commit

Permalink
fix: Allow file uploads if auth is disabled. Fixes #771
Browse files Browse the repository at this point in the history
Revert to pre-0.14 behavior of assuming dev-mode if auth is disabled.
  • Loading branch information
lo5 committed Apr 29, 2021
1 parent ceea559 commit e692969
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions file_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func (fs *FileStore) ServeHTTP(w http.ResponseWriter, r *http.Request) {
case http.MethodPost:
// Disallow if:
// - unauthorized api call
// - auth not enabled or auth enabled and unauthorized
if !fs.keychain.allow(r) && (fs.auth == nil || (fs.auth != nil && !fs.auth.allow(r))) { // API or UI
// - auth enabled and unauthorized
if !fs.keychain.allow(r) && (fs.auth != nil && !fs.auth.allow(r)) { // API or UI
http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
return
}
Expand Down

0 comments on commit e692969

Please sign in to comment.