From 3d1fc9f729044178fe3041b30a4b02484805d96b Mon Sep 17 00:00:00 2001 From: Damien Robinson Date: Fri, 9 Jul 2021 12:00:25 +1000 Subject: [PATCH] fix(glide): prevent adding duplicate base url Use with base to prevent adding duplicate base url --- src/runtime/providers/glide.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/providers/glide.ts b/src/runtime/providers/glide.ts index 612429fe7..4a2540c1f 100644 --- a/src/runtime/providers/glide.ts +++ b/src/runtime/providers/glide.ts @@ -1,7 +1,7 @@ // https://glide.thephpleague.com/2.0/api/quick-reference/ import { ProviderGetImage } from 'src' -import { joinURL, encodeQueryItem, encodePath } from 'ufo' +import { joinURL, encodeQueryItem, encodePath, withBase } from 'ufo' import { createOperationsGenerator } from '~image' const operationsGenerator = createOperationsGenerator({ @@ -50,6 +50,6 @@ export const getImage: ProviderGetImage = (src, { modifiers = {}, baseURL = '/' const params = operationsGenerator(modifiers) return { - url: joinURL(baseURL, encodePath(src) + (params ? '?' + params : '')) + url: withBase(joinURL(encodePath(src) + (params ? '?' + params : '')), baseURL) } }