This commit is contained in:
jetstream0
2023-10-30 06:38:50 +00:00
parent e46382d6ee
commit c2de260d51
2 changed files with 8 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ createServer((req, res) => {
return res.end(); return res.end();
} }
//set content type //set content type
let non_utf8_content_types: string[] = ["image/png", "image/gif"]; let non_utf8_content_types: string[] = ["image/png", "image/gif", "image/jpeg", "video/mp4"];
let content_type: string; let content_type: string;
switch (req_path.split(".")[1]) { switch (req_path.split(".")[1]) {
case "html": case "html":
@@ -40,6 +40,12 @@ createServer((req, res) => {
case "gif": case "gif":
content_type = "image/gif"; content_type = "image/gif";
break; break;
case "jpg":
content_type = "image/jpeg";
break;
case "mp4":
content_type = "video/mp4";
break;
default: default:
content_type = "text/plain"; content_type = "text/plain";
} }

View File

@@ -31,7 +31,7 @@
<div id="next-post-container"> <div id="next-post-container">
<a href="/posts/[[ next_post.slug ]]">Next Post: [[ next_post.title ]]</a> <a href="/posts/[[ next_post.slug ]]">Next Post: [[ next_post.title ]]</a>
</div> </div>
[[ endif ]] [[ endif ]]
[[ component:makoto-styling ]] [[ component:makoto-styling ]]
</div> </div>
</body> </body>