Store request.is_localhost like Etiquette.
This commit is contained in:
		
							parent
							
								
									6db7fe9a24
								
							
						
					
					
						commit
						65fdae97da
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -45,7 +45,8 @@ site.localhost_only = False | ||||||
| @site.before_request | @site.before_request | ||||||
| def before_request(): | def before_request(): | ||||||
|     ip = request.remote_addr |     ip = request.remote_addr | ||||||
|     if site.localhost_only and ip != '127.0.0.1': |     request.is_localhost = ip == '127.0.0.1' | ||||||
|  |     if site.localhost_only and not request.is_localhost: | ||||||
|         flask.abort(403) |         flask.abort(403) | ||||||
| 
 | 
 | ||||||
| gzip_minimum_size = 500 | gzip_minimum_size = 500 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue