chore: Reuse isAbsoluteUrl by kof · Pull Request #5587 · webstudio-is/webstudio
added 3 commits
January 27, 2026 13:12…tion When constructing /cgi/image/ URLs for absolute remote URLs like https://example.com/..., the encodePathFragment function was replacing %2F with /, creating paths with // after the protocol. Web servers normalize // to / in URL paths, breaking the remote URL. Now absolute URLs keep slashes fully encoded (%2F) while relative paths continue using unencoded slashes for cleaner URLs.
- Add isAbsoluteUrl function to @webstudio-is/sdk url-pattern module - Add tests for the new utility - Update all consumers to use the shared utility: - packages/image/src/image-loaders.ts - apps/builder/app/canvas/interceptor.ts - apps/builder/app/builder/features/style-panel/sections/backgrounds/background-image.tsx
kof
changed the title
fix: Encode slashes in absolute URLs to prevent path normalization
chore: Reuse isAbsoluteUrl
kof
deleted the
img-loader.staging
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters