Skip to content

Commit 798ddc8

Browse files
committed
chore: remove support for the protocol related URLs because Next.js v13 don't support them
1 parent 65446bc commit 798ddc8

File tree

3 files changed

+1
-26
lines changed

3 files changed

+1
-26
lines changed

src/__tests__/ensure-url-protocol.spec.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/utils/helpers.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,6 @@ export function isRelativeUrl(url: string): boolean {
121121
return url.startsWith('/') && !isProtocolRelativeUrl(url);
122122
}
123123

124-
export function ensureUrlProtocol(url: string): string {
125-
if (isProtocolRelativeUrl(url)) {
126-
return 'https:' + url;
127-
}
128-
return url;
129-
}
130-
131124
export function isCdnUrl(url: string, cdnDomain: string): boolean {
132125
if (isRelativeUrl(url)) {
133126
return false;

src/utils/loader.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ import {
1919
mergeParams,
2020
parseUserParamsString,
2121
trimTrailingSlash,
22-
isRelativeUrl,
23-
ensureUrlProtocol
22+
isRelativeUrl
2423
} from './helpers';
2524

2625
export function uploadcareLoader({
@@ -45,7 +44,6 @@ export function uploadcareLoader({
4544
process.env.NEXT_PUBLIC_UPLOADCARE_APP_BASE_URL || ''
4645
);
4746

48-
src = ensureUrlProtocol(src);
4947
const proxy = trimTrailingSlash(proxyEndpoint);
5048
const isProductionMode = isProduction();
5149
const isImageOnCdn = isCdnUrl(src, cdnDomain);

0 commit comments

Comments
 (0)