Skip to content

Commit b230481

Browse files
committed
Use an absolute URL to ingest FileAttachments in DuckDB.
1 parent 301bd60 commit b230481

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/duckdb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ async function insertFile(database, name, file, options) {
171171
const buffer = await file.arrayBuffer();
172172
await database.registerFileBuffer(file.name, new Uint8Array(buffer));
173173
} else {
174-
await database.registerFileURL(file.name, url, 4); // duckdb.DuckDBDataProtocol.HTTP
174+
await database.registerFileURL(file.name, new URL(url, document.location).href, 4); // duckdb.DuckDBDataProtocol.HTTP
175175
}
176176
const connection = await database.connect();
177177
try {

0 commit comments

Comments
 (0)