Skip to content

Commit

Permalink
fix(s3 and gs): passthrough relative uri in import handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Oct 24, 2023
1 parent c2d9475 commit 64c2dcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/io/amazonS3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { URL } from 'whatwg-url';
* @param uri
* @returns
*/
export const isAmazonS3Uri = (uri: string) => new URL(uri).protocol === 's3:';
export const isAmazonS3Uri = (uri: string) =>
new URL(uri, window.location.origin).protocol === 's3:';

export type ObjectAvailableCallback = (url: string, name: string) => void;

Expand Down
2 changes: 1 addition & 1 deletion src/io/googleCloudStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface GcsObjectListResult {
* @returns
*/
export const isGoogleCloudStorageUri = (uri: string) =>
new URL(uri).protocol === 'gs:';
new URL(uri, window.location.origin).protocol === 'gs:';

/**
* Extracts bucket and prefix from `gs://` URIs
Expand Down

0 comments on commit 64c2dcf

Please sign in to comment.