mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -05:00 
			
		
		
		
	fileserver: Don't replace in request paths (fix #4027)
This commit is contained in:
		
							parent
							
								
									ec309c6d52
								
							
						
					
					
						commit
						5bf0a55df4
					
				@ -138,12 +138,11 @@ func (fsrv *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request, next c
 | 
				
			|||||||
	filesToHide := fsrv.transformHidePaths(repl)
 | 
						filesToHide := fsrv.transformHidePaths(repl)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	root := repl.ReplaceAll(fsrv.Root, ".")
 | 
						root := repl.ReplaceAll(fsrv.Root, ".")
 | 
				
			||||||
	suffix := repl.ReplaceAll(r.URL.Path, "")
 | 
						filename := sanitizedPathJoin(root, r.URL.Path)
 | 
				
			||||||
	filename := sanitizedPathJoin(root, suffix)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fsrv.logger.Debug("sanitized path join",
 | 
						fsrv.logger.Debug("sanitized path join",
 | 
				
			||||||
		zap.String("site_root", root),
 | 
							zap.String("site_root", root),
 | 
				
			||||||
		zap.String("request_path", suffix),
 | 
							zap.String("request_path", r.URL.Path),
 | 
				
			||||||
		zap.String("result", filename))
 | 
							zap.String("result", filename))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// get information about the file
 | 
						// get information about the file
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user