Spaces:
Sleeping
Sleeping
Support multiple keys, no need to use ";" combination
Browse files
main.py
CHANGED
@@ -40,8 +40,8 @@ def proxy():
|
|
40 |
headers = dict(request.headers)
|
41 |
headers.pop('Host', None)
|
42 |
headers.pop('Content-Length', None)
|
43 |
-
keys = request.headers['Authorization'].split(' ')[1].
|
44 |
-
headers['Authorization'] = f'Bearer {random.choice(keys)}'
|
45 |
headers['X-Use-Cache'] = 'false'
|
46 |
|
47 |
json_data = request.get_json()
|
|
|
40 |
headers = dict(request.headers)
|
41 |
headers.pop('Host', None)
|
42 |
headers.pop('Content-Length', None)
|
43 |
+
keys = request.headers['Authorization'].split(' ')[1].replace(';','').split('hf_')
|
44 |
+
headers['Authorization'] = f'Bearer hf_{random.choice(keys)}'
|
45 |
headers['X-Use-Cache'] = 'false'
|
46 |
|
47 |
json_data = request.get_json()
|