Skip to content

Commit

Permalink
fix(glide): prevent adding duplicate base url (#362)
Browse files Browse the repository at this point in the history
Use with base to prevent adding duplicate base url
  • Loading branch information
shadow81627 authored Jul 9, 2021
1 parent ad6c1ae commit d792e1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/providers/glide.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -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)
}
}

0 comments on commit d792e1e

Please sign in to comment.