@adonisjs/http-server
Advanced tools
Comparing version
@@ -8,6 +8,6 @@ import etag from 'etag'; | ||
import onFinished from 'on-finished'; | ||
import { promisify } from 'node:util'; | ||
import json from '@poppinss/utils/json'; | ||
import Macroable from '@poppinss/macroable'; | ||
import { createReadStream, stat } from 'node:fs'; | ||
import { createReadStream } from 'node:fs'; | ||
import { stat } from 'node:fs/promises'; | ||
import { RuntimeException } from '@poppinss/utils'; | ||
@@ -18,3 +18,2 @@ import contentDisposition from 'content-disposition'; | ||
import { E_HTTP_REQUEST_ABORTED } from './exceptions.js'; | ||
const statFn = promisify(stat); | ||
const CACHEABLE_HTTP_METHODS = ['GET', 'HEAD']; | ||
@@ -208,3 +207,3 @@ export class Response extends Macroable { | ||
try { | ||
const stats = await statFn(filePath); | ||
const stats = await stat(filePath); | ||
if (!stats || !stats.isFile()) { | ||
@@ -211,0 +210,0 @@ throw new TypeError('response.download only accepts path to a file'); |
{ | ||
"name": "@adonisjs/http-server", | ||
"version": "6.8.2-2", | ||
"version": "6.8.2-3", | ||
"description": "AdonisJS HTTP server with support packed with Routing and Cookies", | ||
@@ -55,3 +55,3 @@ "main": "build/index.js", | ||
"@japa/spec-reporter": "^1.3.3", | ||
"@swc/core": "^1.3.39", | ||
"@swc/core": "^1.3.40", | ||
"@types/accepts": "^1.3.5", | ||
@@ -67,3 +67,3 @@ "@types/content-disposition": "^0.5.5", | ||
"@types/mime-types": "^2.1.1", | ||
"@types/node": "^18.15.0", | ||
"@types/node": "^18.15.2", | ||
"@types/on-finished": "^2.3.1", | ||
@@ -70,0 +70,0 @@ "@types/pem": "^1.9.6", |
148866
-0.03%3879
-0.03%