Skip to content

Commit

Permalink
fix: encode all urls
Browse files Browse the repository at this point in the history
fixes #78

this should ideally be done in the api server, but doing this breaking change at the client library first, so when we do it at the backend, only folks who are using the api directly will need to upgrade.
  • Loading branch information
inian committed Aug 8, 2022
1 parent 87e143d commit 588c972
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/StorageFileApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class StorageFileApi {
{ expiresIn },
{ headers: this.headers }
)
const signedURL = `${this.url}${data.signedURL}`
const signedURL = encodeURI(`${this.url}${data.signedURL}`)
data = { signedURL }
return { data, error: null, signedURL }
} catch (error) {
Expand Down Expand Up @@ -335,7 +335,7 @@ export class StorageFileApi {
return {
data: data.map((datum: { signedURL: string }) => ({
...datum,
signedURL: datum.signedURL ? `${this.url}${datum.signedURL}` : null,
signedURL: datum.signedURL ? encodeURI(`${this.url}${datum.signedURL}`) : null,
})),
error: null,
}
Expand Down Expand Up @@ -389,7 +389,7 @@ export class StorageFileApi {
*/
getPublicUrl(path: string): string {
const _path = this._getFinalPath(path)
return `${this.url}/object/public/${_path}`
return encodeURI(`${this.url}/object/public/${_path}`)
}

/**
Expand Down

0 comments on commit 588c972

Please sign in to comment.