Skip to content

Commit 39f8f58

Browse files
committed
support full URL paths and CDN relative paths in getURLInformation()
1 parent 33dad46 commit 39f8f58

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/lib/cloudinary.cfc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,20 @@ component {
231231

232232
else if (refind(reCDN, arguments.file)) {
233233
stResult["source"] = rereplace(arguments.file, reCDN, "/");
234+
if (uploadVia eq "fetch"){
235+
stResult["type"] = "fetch";
236+
stResult["untransformed"] = apiURLPrefix & "/fetch/" & urlEncodedFormat(arguments.file);
237+
stResult["template"] = rereplace(stResult.untransformed, "/fetch/", "/fetch/{transformation}/");
238+
}
239+
else if (uploadVia eq "auto"){
240+
stResult["type"] = "auto";
241+
stResult["untransformed"] = apiURLPrefix & "/upload" & stResult.source;
242+
stResult["template"] = rereplace(stResult.untransformed, "/upload/", "/upload/{transformation}/");
243+
}
244+
}
234245

246+
else {
247+
stResult["source"] = arguments.file;
235248
if (uploadVia eq "fetch"){
236249
stResult["type"] = "fetch";
237250
stResult["untransformed"] = apiURLPrefix & "/fetch/" & urlEncodedFormat(application.fc.lib.cdn.ioGetFileLocation(location="images", file=arguments.file, bReceive=true, protocol="http").path);

0 commit comments

Comments
 (0)