| 313 | print("%s - %s" % (self.address_string(), fmt % args), flush=True) |
| 314 | |
| 315 | def end_headers(self): |
| 316 | self.send_header("Cache-Control", "no-store") |
| 317 | if CORS_ORIGIN: |
| 318 | self.send_header("Access-Control-Allow-Origin", CORS_ORIGIN) |
| 319 | self.send_header("Access-Control-Allow-Headers", "Authorization, Content-Type, X-Admin-Token") |
| 320 | self.send_header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS") |
| 321 | super().end_headers() |
| 322 | |
| 323 | def send_json(self, status, payload): |
| 324 | data = json.dumps(payload, ensure_ascii=False).encode("utf-8") |