From f67554c141d3e2d66016ffb541f0d653b65e3817 Mon Sep 17 00:00:00 2001 From: Il Harper Date: Mon, 12 May 2025 00:41:42 +0800 Subject: [PATCH] fix: fix `http.file()` with relative url --- packages/core/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 416de96..782c1b3 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -414,6 +414,8 @@ export class HTTP extends Service { } async file(this: HTTP, url: string, options: FileOptions = {}): Promise { + const config = this.resolveConfig() + url = this.resolveURL(url, config).toString() const task = await this.ctx.serial(this, 'http/file', url, options) if (task) return task // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types