js-url-gen icon indicating copy to clipboard operation
js-url-gen copied to clipboard

`cloudName` required unnecessarily

Open cprussin opened this issue 2 years ago • 0 comments

In https://github.com/cloudinary/js-url-gen/blob/e1b97191fff165b6ecb353acb2477cc25a062667/src/assets/CloudinaryFile.ts#L182-L193 a cloudName setting is explicitly required. However, in https://github.com/cloudinary/js-url-gen/blob/e1b97191fff165b6ecb353acb2477cc25a062667/src/internal/url/cloudinaryURL.ts#L20-L51 the cloudName isn't actually even utilized if using a secureDistribution and privateCDN.

The check for cloudName should be moved into getUrlPrefix and we should only throw when omitting the cloud name for branches where it's actually utilized.

cprussin avatar Dec 12 '23 18:12 cprussin