-
Notifications
You must be signed in to change notification settings - Fork 212
Open
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @tus/[email protected]
for the project I'm working on.
Steps to reproduce:
- Uploading a file to azure blob store.
- Navigate to uploaded file url provided by the Tus Server.
- Request fails with 500 error and message "Metadata string is not valid".
Here is the diff that solved my problem:
diff --git a/node_modules/@tus/azure-store/dist/index.js b/node_modules/@tus/azure-store/dist/index.js
index 77efab1..1ad25c9 100644
--- a/node_modules/@tus/azure-store/dist/index.js
+++ b/node_modules/@tus/azure-store/dist/index.js
@@ -71,7 +71,7 @@ export class AzureStore extends DataStore {
const upload = JSON.parse(propertyData.metadata.upload);
// Metadata is base64 encoded to avoid errors for non-ASCII characters
// so we need to decode it separately
- upload.metadata = Metadata.parse(JSON.stringify(upload.metadata ?? {}));
+ upload.metadata = upload.metadata ? Metadata.parse(upload.metadata) : {};
await this.cache.set(appendBlobClient.url, upload);
log('metadata returned from blob get properties');
return upload;
This issue body was partially generated by patch-package.
Metadata
Metadata
Assignees
Labels
No labels