Skip to content

Commit

Permalink
fix: subdomain media URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Raid55 committed Nov 1, 2021
1 parent d8d25b3 commit 0332d21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/studio-be/src/common/url.ts
@@ -1,5 +1,5 @@
export const isBpUrl = (str: string): boolean => {
const re = /^\/api\/.*\/bots\/.*\/media\/.*/g
const re = /^api\/.*\/bots\/.*\/media\/.*/g

return re.test(str)
}
Expand Down
Expand Up @@ -50,9 +50,9 @@ export class GhostMediaService implements MediaService {
// make sure the file name is a valid URI
fileName = encodeURIComponent(fileName)
if (this.botId) {
return `/api/v1/bots/${this.botId}/media/${fileName}`
return `api/v1/bots/${this.botId}/media/${fileName}`
} else {
return `/api/v1/media/${fileName}`
return `api/v1/media/${fileName}`
}
}
}

0 comments on commit 0332d21

Please sign in to comment.