mirror of
				https://github.com/spring-projects/spring-security.git
				synced 2025-10-30 22:28:46 +00:00 
			
		
		
		
	Release ByteBuf
Closes gh-9661
This commit is contained in:
		
							parent
							
								
									c8b6dc390d
								
							
						
					
					
						commit
						8ab7a27a20
					
				| @ -1,5 +1,5 @@ | |||||||
| /* | /* | ||||||
|  * Copyright 2019 the original author or authors. |  * Copyright 2019-2021 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
| @ -67,7 +67,9 @@ public class AuthenticationPayloadExchangeConverter implements PayloadExchangeAu | |||||||
| 		if (authenticationMetadata == null) { | 		if (authenticationMetadata == null) { | ||||||
| 			return null; | 			return null; | ||||||
| 		} | 		} | ||||||
| 		ByteBuf rawAuthentication = ByteBufAllocator.DEFAULT.buffer().writeBytes(authenticationMetadata); | 		ByteBuf rawAuthentication = ByteBufAllocator.DEFAULT.buffer(); | ||||||
|  | 		try { | ||||||
|  | 			rawAuthentication.writeBytes(authenticationMetadata); | ||||||
| 			if (!AuthMetadataFlyweight.isWellKnownAuthType(rawAuthentication)) { | 			if (!AuthMetadataFlyweight.isWellKnownAuthType(rawAuthentication)) { | ||||||
| 				return null; | 				return null; | ||||||
| 			} | 			} | ||||||
| @ -79,6 +81,10 @@ public class AuthenticationPayloadExchangeConverter implements PayloadExchangeAu | |||||||
| 			} | 			} | ||||||
| 			throw new IllegalArgumentException("Unknown Mime Type " + wellKnownAuthType); | 			throw new IllegalArgumentException("Unknown Mime Type " + wellKnownAuthType); | ||||||
| 		} | 		} | ||||||
|  | 		finally { | ||||||
|  | 			rawAuthentication.release(); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	private Authentication simple(ByteBuf rawAuthentication) { | 	private Authentication simple(ByteBuf rawAuthentication) { | ||||||
| 		ByteBuf rawUsername = AuthMetadataFlyweight.decodeUsername(rawAuthentication); | 		ByteBuf rawUsername = AuthMetadataFlyweight.decodeUsername(rawAuthentication); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user