mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 10:37:24 -04:00 
			
		
		
		
	fileserver: Fix "go up" links in browse listings (closes #3942)
At some point we changed how paths are represented down the function calls of browse listings and forgot to update the canGoUp logic. I think this is right? It's simpler now.
This commit is contained in:
		
							parent
							
								
									38a83ca6f8
								
							
						
					
					
						commit
						d8bcf5be4e
					
				| @ -99,9 +99,8 @@ func (fsrv *FileServer) loadDirectoryContents(dir *os.File, root, urlPath string | |||||||
| 		return browseListing{}, err | 		return browseListing{}, err | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// determine if user can browse up another folder | 	// user can presumably browse "up" to parent folder if path is longer than "/" | ||||||
| 	curPathDir := path.Dir(strings.TrimSuffix(urlPath, "/")) | 	canGoUp := len(urlPath) > 1 | ||||||
| 	canGoUp := strings.HasPrefix(curPathDir, root) |  | ||||||
| 
 | 
 | ||||||
| 	return fsrv.directoryListing(files, canGoUp, root, urlPath, repl), nil | 	return fsrv.directoryListing(files, canGoUp, root, urlPath, repl), nil | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user