Let cached_endpoint pass the content-type header through.
This commit is contained in:
		
							parent
							
								
									5d802ba9f9
								
							
						
					
					
						commit
						e09c3300d1
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -43,6 +43,8 @@ def cached_endpoint(max_age): | ||||||
|             if (not state['max_age']) or (time.time() - state['last_run'] > state['max_age']): |             if (not state['max_age']) or (time.time() - state['last_run'] > state['max_age']): | ||||||
|                 value = function(*args, **kwargs) |                 value = function(*args, **kwargs) | ||||||
|                 if isinstance(value, flask.Response): |                 if isinstance(value, flask.Response): | ||||||
|  |                     if value.headers.get('Content-Type'): | ||||||
|  |                         state['headers']['Content-Type'] = value.headers.get('Content-Type') | ||||||
|                     value = value.response |                     value = value.response | ||||||
|                 if value != state['stored_value']: |                 if value != state['stored_value']: | ||||||
|                     state['stored_value'] = value |                     state['stored_value'] = value | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue