| 
									
										
										
										
											2024-04-20 20:58:56 -04:00
										 |  |  | from WebHostLib import app | 
					
						
							|  |  |  | from flask import abort | 
					
						
							|  |  |  | from . import cache | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @cache.cached() | 
					
						
							|  |  |  | @app.route('/robots.txt') | 
					
						
							|  |  |  | def robots(): | 
					
						
							|  |  |  |     # If this host is not official, do not allow search engine crawling | 
					
						
							|  |  |  |     if not app.config["ASSET_RIGHTS"]: | 
					
						
							| 
									
										
										
										
											2024-06-21 14:54:19 +02:00
										 |  |  |         # filename changed in case the path is intercepted and served by an outside service | 
					
						
							|  |  |  |         return app.send_static_file('robots_file.txt') | 
					
						
							| 
									
										
										
										
											2024-04-20 20:58:56 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Send 404 if the host has affirmed this to be the official WebHost | 
					
						
							|  |  |  |     abort(404) |