Improve technique for finding cookie set by function.
Instead of iterating through all the outgoing headers.
This commit is contained in:
		
							parent
							
								
									be0fca729f
								
							
						
					
					
						commit
						55e1281774
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		|  | @ -70,10 +70,8 @@ class SessionManager: | |||
| 
 | ||||
|             # Send the token back to the client | ||||
|             # but only if the endpoint didn't manually set the cookie. | ||||
|             for (headerkey, value) in response.headers: | ||||
|                 if headerkey == 'Set-Cookie' and value.startswith('etiquette_session='): | ||||
|                     break | ||||
|             else: | ||||
|             function_cookies = response.headers.get_all('Set-Cookie') | ||||
|             if not any('etiquette_session=' in cookie for cookie in function_cookies): | ||||
|                 response.set_cookie( | ||||
|                     'etiquette_session', | ||||
|                     value=session.token, | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue