We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 733ebce + 55e54fc commit cff6cedCopy full SHA for cff6ced
1 file changed
src/offscreen/handlers/notary_prove.ts
@@ -196,12 +196,16 @@ async function calculateResponseSize(
196
197
const contentLength = response.headers.get('content-length');
198
199
- if (!contentLength) {
200
- throw new Error('no content length in response headers');
+ let bodySize: number;
+
201
+ if (contentLength) {
202
+ bodySize = parseInt(contentLength, 10);
203
+ } else {
204
+ console.debug('fallback to measuring response blob due to no content-length header');
205
+ const blob = await response.blob();
206
+ bodySize = blob.size;
207
}
208
- const bodySize = parseInt(contentLength, 10);
-
209
return headersSize + bodySize;
210
211
0 commit comments