From 4028a6d16e88c2e3592b1d933e9f840a0f614c22 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 29 Apr 2024 18:31:55 +0200 Subject: [PATCH] @uppy/companion: coerce `requestUrl` to a string (#5128) --- packages/@uppy/companion/src/server/helpers/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@uppy/companion/src/server/helpers/request.js b/packages/@uppy/companion/src/server/helpers/request.js index e9631eef71..e18cc40c94 100644 --- a/packages/@uppy/companion/src/server/helpers/request.js +++ b/packages/@uppy/companion/src/server/helpers/request.js @@ -119,7 +119,7 @@ exports.getURLMeta = async (url, blockLocalIPs = false) => { // we add random string to avoid duplicate files const filename = response.headers['content-disposition'] ? contentDisposition.parse(response.headers['content-disposition']).parameters.filename - : path.basename(response.request.requestUrl) + : path.basename(`${response.request.requestUrl}`) // No need to get the rest of the response, as we only want header (not really relevant for HEAD, but why not) stream.destroy()