You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
Add some auth tests
Former-commit-id: 7a6286d40a95a16af483ba4e253e020805647ac8 [formerly b9c0c7b3dfc13391a82e05eb1a7be94d067b1327] [formerly ed44abc1ba59afc19e402eeb5ab42ffeeff80d23 [formerly e6e1984c47]]
Former-commit-id: 13290a47d1dd5f4218b873951b4ddb798cd54dd2 [formerly 27db473259f4927be4bfd55b88e57fb87814d8d1]
Former-commit-id: 2ef8c236e62859b8cacef5b5e679780de7f22add
This commit is contained in:
4
auth.go
4
auth.go
@@ -94,10 +94,10 @@ type extractor []string
|
||||
func (e extractor) ExtractToken(r *http.Request) (string, error) {
|
||||
token, _ := request.AuthorizationHeaderExtractor.ExtractToken(r)
|
||||
|
||||
// Checks if the token isn't empty and if it contains three dots.
|
||||
// Checks if the token isn't empty and if it contains two dots.
|
||||
// The former prevents incompatibility with URLs that previously
|
||||
// used basic auth.
|
||||
if token != "" && strings.Count(token, ".") == 3 {
|
||||
if token != "" && strings.Count(token, ".") == 2 {
|
||||
return token, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user