Spaces:
Running
Running
T1ckbase
commited on
Commit
·
d82c975
1
Parent(s):
54ba1c5
remove Authorization header
Browse files
main.ts
CHANGED
@@ -13,9 +13,13 @@ app.post('*', async (c) => {
|
|
13 |
const url = new URL(c.req.url);
|
14 |
const targetPath = url.pathname + url.search;
|
15 |
const targetUrl = `${HF_API_URL}${targetPath}`;
|
|
|
|
|
|
|
|
|
16 |
return await fetch(targetUrl, {
|
17 |
method: 'POST',
|
18 |
-
headers:
|
19 |
body: c.req.raw.body,
|
20 |
});
|
21 |
});
|
|
|
13 |
const url = new URL(c.req.url);
|
14 |
const targetPath = url.pathname + url.search;
|
15 |
const targetUrl = `${HF_API_URL}${targetPath}`;
|
16 |
+
|
17 |
+
const headers = new Headers(c.req.raw.headers);
|
18 |
+
headers.delete('Authorization');
|
19 |
+
|
20 |
return await fetch(targetUrl, {
|
21 |
method: 'POST',
|
22 |
+
headers: headers,
|
23 |
body: c.req.raw.body,
|
24 |
});
|
25 |
});
|