Avinash commited on
Commit
2878e4e
·
1 Parent(s): 2652f31

fix: return 200 on / and /? to stop HF log probes

Browse files
Files changed (1) hide show
  1. worker.py +2 -1
worker.py CHANGED
@@ -15,7 +15,8 @@ if not API_BASE or not WORKER_TOKEN:
15
 
16
  class Handler(BaseHTTPRequestHandler):
17
  def do_GET(self):
18
- if self.path.startswith("/health"):
 
19
  self.send_response(200)
20
  self.end_headers()
21
  self.wfile.write(b"ok\n")
 
15
 
16
  class Handler(BaseHTTPRequestHandler):
17
  def do_GET(self):
18
+ # HF sometimes calls "/" or "/?logs=container" while rendering logs.
19
+ if self.path.startswith("/health") or self.path == "/" or self.path.startswith("/?"):
20
  self.send_response(200)
21
  self.end_headers()
22
  self.wfile.write(b"ok\n")