mirror of
				https://github.com/launchbadge/sqlx.git
				synced 2025-11-03 23:12:47 +00:00 
			
		
		
		
	URL decode database name when parsing connection url (#3593)
This commit is contained in:
		
							parent
							
								
									a7f2928a1b
								
							
						
					
					
						commit
						e3ef8baf23
					
				@ -40,7 +40,11 @@ impl PgConnectOptions {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        let path = url.path().trim_start_matches('/');
 | 
					        let path = url.path().trim_start_matches('/');
 | 
				
			||||||
        if !path.is_empty() {
 | 
					        if !path.is_empty() {
 | 
				
			||||||
            options = options.database(path);
 | 
					            options = options.database(
 | 
				
			||||||
 | 
					                &percent_decode_str(path)
 | 
				
			||||||
 | 
					                    .decode_utf8()
 | 
				
			||||||
 | 
					                    .map_err(Error::config)?,
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (key, value) in url.query_pairs().into_iter() {
 | 
					        for (key, value) in url.query_pairs().into_iter() {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user