Skip to content

Commit

Permalink
Fix url (tldraw#5276)
Browse files Browse the repository at this point in the history
Fix? 

### Change type

- [x] `bugfix`
  • Loading branch information
MitjaBezensek authored Jan 23, 2025
1 parent a736cb3 commit 15e81d4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions apps/dotcom/sync-worker/src/TLDrawDurableObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,12 +613,8 @@ export class TLDrawDurableObject extends DurableObject {
httpMetadata: currentAsset.httpMetadata,
})
asset.props.src = asset.props.src.replace(objectName, newObjectName)
if (asset.props.src.includes(this.env.ASSET_UPLOAD_ORIGIN)) {
asset.props.src.replace(
this.env.ASSET_UPLOAD_ORIGIN,
`${this.env.MULTIPLAYER_SERVER}/api/app`
)
}
assert(this.env.MULTIPLAYER_SERVER, 'MULTIPLAYER_SERVER must be present')
asset.props.src = `${this.env.MULTIPLAYER_SERVER.replace(/^ws/, 'http')}/api/app/uploads/${newObjectName}`

asset.meta.fileId = slug
store.put(asset)
Expand Down

0 comments on commit 15e81d4

Please sign in to comment.