Skip to content

Commit 7218a7f

Browse files
committed
fix incorrect date type handler for blob objects
1 parent 8a32f82 commit 7218a7f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/client.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,19 @@ export class ScrapflyClient {
116116
throw e;
117117
}
118118

119-
const content: string = await response.text();
120-
result.content = content;
119+
let content;
120+
121121
if (format === 'clob') {
122+
content = await response.text();
122123
result.format = 'text';
123124
}
125+
124126
if (format === 'blob') {
127+
content = Buffer.from(await response.arrayBuffer());
125128
result.format = 'binary';
126129
}
130+
131+
result.content = content;
127132
return result;
128133
}
129134

0 commit comments

Comments
 (0)