Skip to content

Commit

Permalink
Make sure w parameter is only included when a width is provided. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Oct 17, 2020
1 parent 8204154 commit b37835a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/client/image.tsx
Expand Up @@ -178,5 +178,7 @@ function cloudinaryLoader({ root, src, width }: LoaderProps): string {

function defaultLoader({ root, src, width }: LoaderProps): string {
// TODO: change quality parameter to be configurable
return `${root}?url=${encodeURIComponent(src)}&w=${width}&q=100`
return `${root}?url=${encodeURIComponent(src)}&${
width ? `w=${width}&` : ''
}q=100`
}

0 comments on commit b37835a

Please sign in to comment.