bun-router 0.2.4 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,13 +35,10 @@ const file = async (filepath: string): Promise<Response> => {
35
35
  }
36
36
 
37
37
  const html = async (content: string): Promise<Response> => {
38
- const buff = Buffer.from(content);
39
- const c = buff.toString('hex');
40
-
41
- const response = new Response(c, {
38
+ const response = new Response(content, {
42
39
  status: 200,
43
40
  statusText: 'ok',
44
- headers: {'Content-Type': 'text/html'},
41
+ headers: {'Content-Type': 'text/html; charset=utf-8'},
45
42
  });
46
43
 
47
44
  return new Promise<Response>((resolve) => {
package/package.json CHANGED
@@ -8,5 +8,5 @@
8
8
  "peerDependencies": {
9
9
  "typescript": "^5.0.0"
10
10
  },
11
- "version": "0.2.4"
11
+ "version": "0.2.6"
12
12
  }
@@ -8,7 +8,7 @@ describe('Helpers', async () => {
8
8
  const res = await file(fp);
9
9
  const contentType = res.headers.get('Content-Type');
10
10
 
11
- expect(contentType).toBe('text/html');
11
+ expect(contentType).toBe('text/html; charset=utf-8');
12
12
  expect(res.status).toBe(200);
13
13
  });
14
14