mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	browse: return forbidden (403) only when it is a permission error.
This commit is contained in:
		
							parent
							
								
									e2273ea676
								
							
						
					
					
						commit
						a1312465b5
					
				@ -99,8 +99,11 @@ func (b Browse) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
 | 
			
		||||
		// Load directory contents
 | 
			
		||||
		file, err := os.Open(b.Root + r.URL.Path)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			if os.IsPermission(err) {
 | 
			
		||||
				return http.StatusForbidden, err
 | 
			
		||||
			}
 | 
			
		||||
			return http.StatusNotFound, err
 | 
			
		||||
		}
 | 
			
		||||
		defer file.Close()
 | 
			
		||||
 | 
			
		||||
		files, err := file.Readdir(-1)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user