Skip to content

Commit

Permalink
Properly return 0 instead of emtpy return
Browse files Browse the repository at this point in the history
This emerged while investigating #1658, but reproduction is not deterministic so hard to say
  • Loading branch information
carlopi committed May 8, 2024
1 parent b22b361 commit 192ccfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/duckdb-wasm/src/bindings/runtime_browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export const BROWSER_RUNTIME: DuckDBRuntime & {
// so we need (if enabled) to bump to a ranged GET
if (!BROWSER_RUNTIME.getGlobalFileInfo(mod)?.allowFullHttpReads) {
failWith(mod, `HEAD request failed: ${path}, with full http reads are disabled`);
return;
return 0;
}
const xhr2 = new XMLHttpRequest();
if (path.startsWith('s3://')) {
Expand All @@ -322,7 +322,7 @@ export const BROWSER_RUNTIME: DuckDBRuntime & {
xhr2.send(null);
if (xhr2.status != 200 && xhr2.status !== 206) {
failWith(mod, `HEAD and GET requests failed: ${path}`);
return;
return 0;
}
const contentLength = xhr2.getResponseHeader('Content-Length');
if (contentLength && (+contentLength > 1)) {
Expand Down

0 comments on commit 192ccfd

Please sign in to comment.