mirror of
				https://github.com/filebrowser/filebrowser.git
				synced 2025-11-04 11:23:02 +00:00 
			
		
		
		
	fix: disable cookie auth for non GET requests
This commit is contained in:
		
							parent
							
								
									cb43770025
								
							
						
					
					
						commit
						80030dee32
					
				@ -53,10 +53,12 @@ func (e extractor) ExtractToken(r *http.Request) (string, error) {
 | 
				
			|||||||
		return auth, nil
 | 
							return auth, nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if r.Method == http.MethodGet {
 | 
				
			||||||
		cookie, _ := r.Cookie("auth")
 | 
							cookie, _ := r.Cookie("auth")
 | 
				
			||||||
		if cookie != nil && strings.Count(cookie.Value, ".") == 2 {
 | 
							if cookie != nil && strings.Count(cookie.Value, ".") == 2 {
 | 
				
			||||||
			return cookie.Value, nil
 | 
								return cookie.Value, nil
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return "", request.ErrNoTokenInRequest
 | 
						return "", request.ErrNoTokenInRequest
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user