mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:32:43 +00:00 
			
		
		
		
	WebServer: Use relative URLs for the directory listing
This fixes an issue found on Linus's hosted WebServer. Now, if WebServer is hosted at a non-root URL. (eg, `example.com/webserver` instead of `example.com`) the links will correctly go to `example.com/webserver/foo` instead of `example.com/foo`.
This commit is contained in:
		
							parent
							
								
									cce5e3158f
								
							
						
					
					
						commit
						7dfe1f9f8f
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -313,7 +313,7 @@ ErrorOr<void> Client::handle_directory_listing(String const& requested_path, Str | ||||||
| 
 | 
 | ||||||
|         builder.append("<tr>"sv); |         builder.append("<tr>"sv); | ||||||
|         builder.appendff("<td><div class=\"{}\"></div></td>", is_directory ? "folder" : "file"); |         builder.appendff("<td><div class=\"{}\"></div></td>", is_directory ? "folder" : "file"); | ||||||
|         builder.append("<td><a href=\""sv); |         builder.append("<td><a href=\"./"sv); | ||||||
|         builder.append(URL::percent_encode(name)); |         builder.append(URL::percent_encode(name)); | ||||||
|         // NOTE: For directories, we append a slash so we don't always hit the redirect case,
 |         // NOTE: For directories, we append a slash so we don't always hit the redirect case,
 | ||||||
|         //       which adds a slash anyways.
 |         //       which adds a slash anyways.
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Sam Atkins
						Sam Atkins