(h)
| 77 | |
| 78 | |
| 79 | def cors_headers(h): |
| 80 | req_origin = h.headers.get('Origin', '') |
| 81 | if ALLOWED_ORIGIN: |
| 82 | origin = ALLOWED_ORIGIN |
| 83 | elif req_origin in _DEFAULT_ORIGINS: |
| 84 | origin = req_origin |
| 85 | else: |
| 86 | origin = f'http://127.0.0.1:{_DASHBOARD_PORT}' |
| 87 | h.send_header('Access-Control-Allow-Origin', origin) |
| 88 | h.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS') |
| 89 | h.send_header('Access-Control-Allow-Headers', 'Content-Type') |
| 90 | |
| 91 | |
| 92 | def _iter_task_data_dirs(): |
no outgoing calls
no test coverage detected