bun-router 0.2.3 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/router/router.ts +6 -3
- package/package.json +1 -1
package/lib/router/router.ts
CHANGED
@@ -26,7 +26,7 @@ const file = async (filepath: string): Promise<Response> => {
|
|
26
26
|
const response = new Response(content, {
|
27
27
|
status: 200,
|
28
28
|
statusText: 'ok',
|
29
|
-
headers: { 'Content-Type': 'text/html' },
|
29
|
+
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
30
30
|
});
|
31
31
|
|
32
32
|
return new Promise<Response>((resolve) => {
|
@@ -35,10 +35,13 @@ const file = async (filepath: string): Promise<Response> => {
|
|
35
35
|
}
|
36
36
|
|
37
37
|
const html = async (content: string): Promise<Response> => {
|
38
|
-
const
|
38
|
+
const buff = Buffer.from(content);
|
39
|
+
const c = buff.toString('hex');
|
40
|
+
|
41
|
+
const response = new Response(c, {
|
39
42
|
status: 200,
|
40
43
|
statusText: 'ok',
|
41
|
-
headers: {'Content-Type': 'text/html'}
|
44
|
+
headers: {'Content-Type': 'text/html; charset=utf-8'},
|
42
45
|
});
|
43
46
|
|
44
47
|
return new Promise<Response>((resolve) => {
|
package/package.json
CHANGED