mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:22:45 +00:00 
			
		
		
		
	 cb4c279e90
			
		
	
	
		cb4c279e90
		
	
	
	
	
		
			
			This fixes URL fragments containing characters in the fragment encoding set that were not being correctly percent encoded.
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			983 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			983 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <script src="../include.js"></script>
 | |
| <script>
 | |
|     test(() => {
 | |
|         function printURL(input) {
 | |
|             println(input);
 | |
|             const url = new URL(input);
 | |
|             println(`protocol => '${url.protocol}'`);
 | |
|             println(`username => '${url.username}'`);
 | |
|             println(`password => '${url.password}'`);
 | |
|             println(`host => '${url.host}'`);
 | |
|             println(`hostname => '${url.hostname}'`);
 | |
|             println(`port => '${url.port}'`);
 | |
|             println(`pathname => '${url.pathname}'`);
 | |
|             println(`search => '${url.search}'`);
 | |
|             println(`hash => '${url.hash}'`);
 | |
|         }
 | |
| 
 | |
|         for (url of [
 | |
|             'ftp://serenityos.org:21',
 | |
|             'http://[0:1:0:1:0:1:0:1]',
 | |
|             'http://[1:0:1:0:1:0:1:0]',
 | |
|             'http://[1:1:0:0:1:0:0:0]/',
 | |
|             'unknown://serenityos.org:0',
 | |
|             'http://serenityos.org/cat?dog#meow"woof',
 | |
|         ]) {
 | |
|             printURL(url);
 | |
|         }
 | |
|     });
 | |
| </script>
 |