T1ckbase commited on
Commit
ab40919
·
1 Parent(s): b0c01ee
Files changed (1) hide show
  1. main.ts +2 -3
main.ts CHANGED
@@ -10,9 +10,8 @@ app.use(logger());
10
  app.get('/', (c) => c.text('Hello Hono!'));
11
 
12
  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
 
17
  const headers = new Headers(c.req.raw.headers);
18
  headers.delete('Authorization');
 
10
  app.get('/', (c) => c.text('Hello Hono!'));
11
 
12
  app.post('*', async (c) => {
13
+ const { pathname, search } = new URL(c.req.url);
14
+ const targetUrl = `${HF_API_URL}${pathname}${search}`;
 
15
 
16
  const headers = new Headers(c.req.raw.headers);
17
  headers.delete('Authorization');