tuxedocat commited on
Commit
62bf1b5
·
1 Parent(s): 4ee8f13

Omit host from header

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -24,10 +24,9 @@ def get_token() -> str:
24
  )
25
 
26
 
27
- def get_headers(host: str) -> dict:
28
  return {
29
  "Authorization": f"Bearer {get_token()}",
30
- "Host": host,
31
  "Accept": "application/json",
32
  "Content-Type": "application/json",
33
  }
@@ -35,7 +34,7 @@ def get_headers(host: str) -> dict:
35
 
36
  def proxy(request: httpx.Request, model_info: dict) -> httpx.Request:
37
  request.url = request.url.copy_with(path=model_info["endpoint"])
38
- request.headers.update(get_headers(host=model_info["host"]))
39
  return request
40
 
41
 
 
24
  )
25
 
26
 
27
+ def get_headers() -> dict:
28
  return {
29
  "Authorization": f"Bearer {get_token()}",
 
30
  "Accept": "application/json",
31
  "Content-Type": "application/json",
32
  }
 
34
 
35
  def proxy(request: httpx.Request, model_info: dict) -> httpx.Request:
36
  request.url = request.url.copy_with(path=model_info["endpoint"])
37
+ request.headers.update(get_headers())
38
  return request
39
 
40