Autodesk-Forge / forge-api-nodejs-client

Forge Node.js SDK: Provides Node.js SDK to help you easily integrate Forge REST APIs into the application
Apache License 2.0
121 stars 87 forks source link

ObjectsApi.uploadObject set x-ads-content-sha1 header #72

Closed ilseva closed 2 years ago

ilseva commented 3 years ago

Hi all, I think that there is no way to set the x-ads-content-sha1 header using this wrapper. You can pass the If-Match parameter, but according to API documentation they are different

If-Match | When overwriting an object, use the latest SHA-1 hash to verify that you are overwriting the latest data.A SHA-1 hash is returned every time you upload or overwrite an object. If the SHA-1 hash in the header does not match the current SHA-1 hash stored for this object in OSS, the request fails (status code 412).

x-ads-content-sha1 | A SHA-1 checksum of the object represented as a hexadecimal string.If the SHA-1 hash in the header does not match the SHA-1 hash computed by the server for the uploaded object, the request fails (status code 400).

Thanks.

cyrillef commented 3 years ago

Hi, you are correct, I added this into the source code and will release a new version soon

cyrillef commented 2 years ago

submitted in version v0.9.0+