Unverified Commit b37835ac authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Make sure `w` parameter is only included when a width is provided. (#17971)

parent 82041542
......@@ -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`
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment