Browse Source
			
			
			Merge pull request #3376 from jjlin/knowndevices-nopad
			
				Decode knowndevice `X-Request-Email` as base64url with no padding
			
			
				pull/3390/head
			
			
		 
		
			
				
					
						 Daniel García
					
					3 years ago
						Daniel García
					
					3 years ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: 4AEE18F83AFDEB23
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
1 additions and 
1 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/api/core/accounts.rs
				
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -899,7 +899,7 @@ impl<'r> FromRequest<'r> for KnownDevice { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> { |  |  |     async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> { | 
			
		
	
		
		
			
				
					|  |  |         let email = if let Some(email_b64) = req.headers().get_one("X-Request-Email") { |  |  |         let email = if let Some(email_b64) = req.headers().get_one("X-Request-Email") { | 
			
		
	
		
		
			
				
					
					|  |  |             let email_bytes = match data_encoding::BASE64URL.decode(email_b64.as_bytes()) { |  |  |             let email_bytes = match data_encoding::BASE64URL_NOPAD.decode(email_b64.as_bytes()) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                 Ok(bytes) => bytes, |  |  |                 Ok(bytes) => bytes, | 
			
		
	
		
		
			
				
					|  |  |                 Err(_) => { |  |  |                 Err(_) => { | 
			
		
	
		
		
			
				
					|  |  |                     return Outcome::Failure(( |  |  |                     return Outcome::Failure(( | 
			
		
	
	
		
		
			
				
					|  | 
 |