@@ -120,7 +120,7 @@ private static String readFileAsString(ActionContext context, String name) {
120120
121121 /**
122122 * Replace all keys with __file__ prefix to keys without __file__ prefix and replace value of
123- * those keys with local path to file.
123+ * those keys with local path to file. In case of URL it will leave the value unchanged.
124124 *
125125 * @param map Map with arguments from ActionContext.
126126 * @param htmlTemplateName Name of file with HTML template.
@@ -143,13 +143,18 @@ private static Map<String, Object> replaceFileToLocalPath(Map<String, Object> ma
143143 if (filePath == null ) {
144144 continue ;
145145 }
146- File f = new File (filePath );
147- String localPath = "file://" + f .getAbsolutePath ();
148- if (localPath .contains (Leanplum .getContext ().getPackageName ())) {
149- map .put (key .replace (Values .FILE_PREFIX , "" ),
150- localPath .replace (" " , "%20" ));
146+ if (filePath .startsWith ("http://" ) || filePath .startsWith ("https://" )) {
147+ map .put (key .replace (Values .FILE_PREFIX , "" ), filePath );
148+ map .remove (key );
149+ } else {
150+ File f = new File (filePath );
151+ String localPath = "file://" + f .getAbsolutePath ();
152+ if (localPath .contains (Leanplum .getContext ().getPackageName ())) {
153+ map .put (key .replace (Values .FILE_PREFIX , "" ),
154+ localPath .replace (" " , "%20" ));
155+ }
156+ map .remove (key );
151157 }
152- map .remove (key );
153158 }
154159 }
155160 return map ;
0 commit comments