MCPcopy Create free account
hub / github.com/vercel/vercel / do_GET

Method do_GET

python/vercel-runtime/tests/fixtures/http_handler.py:8–29  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6
7class handler(BaseHTTPRequestHandler):
8 def do_GET(self):
9 if self.path == "/oidc":
10 self.send_response(200)
11 self.send_header("Content-Type", "text/plain")
12 self.end_headers()
13 token = self.headers.get("x-vercel-oidc-token", "")
14 self.wfile.write(token.encode())
15 return
16
17 if self.path == "/headers":
18 payload = {k.lower(): v for k, v in self.headers.items()}
19 body = json.dumps(payload).encode()
20 self.send_response(200)
21 self.send_header("Content-Type", "application/json")
22 self.end_headers()
23 self.wfile.write(body)
24 return
25
26 self.send_response(200)
27 self.send_header("Content-Type", "text/plain")
28 self.end_headers()
29 self.wfile.write(f"GET {self.path}".encode())
30
31 def do_POST(self):
32 content_length = int(self.headers.get("Content-Length", 0))

Callers

nothing calls this directly

Calls 5

lowerMethod · 0.80
getMethod · 0.65
writeMethod · 0.45
encodeMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected