Skip to content

Commit 887c33a

Browse files
authored
Merge pull request #2638 from CPogX/develop
handle mp4 like any other media in Embed toMap()
2 parents 6a9b56e + a9b438c commit 887c33a

File tree

1 file changed

+2
-9
lines changed
  • karate-core/src/main/java/com/intuit/karate/core

1 file changed

+2
-9
lines changed

karate-core/src/main/java/com/intuit/karate/core/Embed.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,8 @@ public String getAsHtmlTag() {
108108

109109
public Map toMap() {
110110
Map map = new HashMap(2);
111-
if (resourceType == ResourceType.MP4) {
112-
byte[] bytes = FileUtils.toBytes(getAsHtmlTag());
113-
String base64 = Base64.getEncoder().encodeToString(bytes);
114-
map.put("data", base64);
115-
map.put("mime_type", ResourceType.HTML.contentType);
116-
} else {
117-
map.put("data", getBase64());
118-
map.put("mime_type", resourceType.contentType);
119-
}
111+
map.put("data", getBase64());
112+
map.put("mime_type", resourceType.contentType);
120113
return map;
121114
}
122115

0 commit comments

Comments
 (0)