send proper content-length
This commit is contained in:
		@@ -159,10 +159,10 @@ export default class Router {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if(!mime.startsWith("video") && !mime.startsWith("audio")) {
 | 
			
		||||
          res.reply({
 | 
			
		||||
            type: this.#mimes.get(filename.split(".").pop()).toLowerCase(),
 | 
			
		||||
            body: fs.readFileSync(path.join(dir, filename))
 | 
			
		||||
          });
 | 
			
		||||
          res.writeHead(200, {
 | 
			
		||||
            "Content-Length": stat.size,
 | 
			
		||||
            "Content-Type": this.#mimes.get(filename.split(".").pop()).toLowerCase()
 | 
			
		||||
          }).end(fs.readFileSync(path.join(dir, filename)));
 | 
			
		||||
          return this;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user