mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 20:39:05 +00:00
fix error
This commit is contained in:
@@ -569,7 +569,13 @@ function parseUrlForAdapter(urlString: string, adapter: Bun.SQL.__internal.Adapt
|
||||
try {
|
||||
return new URL(defaultProtocol + urlString);
|
||||
} catch (error) {
|
||||
return new URL(encodeURI(defaultProtocol + urlString));
|
||||
try {
|
||||
// can be a "sqlite://file with empty spaces.db"
|
||||
return new URL(encodeURI(defaultProtocol + urlString));
|
||||
} catch {
|
||||
// throw the original error if the URL is invalid
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user