New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot upload buffer in Express route NodeJS #9300
Comments
Thanks for reaching us. Add link to issue 8903. At same time, @thesiti92 would you help to provide the detailed error messages? Thanks, |
i get the generic |
Would you help to provide the server request id? e.g. The RequestId field in body:
It would be nice if the repro is in 5 days. Thanks, |
Here's my entire error string, repro'd 2 mins before posting this
|
The request is put file with sharedKey authN, and it looks like when route with express content-length is not provided.
While in service side, we didn't see Content-Length field. Will check further and see if custom pipeline can help to serve this issue. Will update this thread further. |
axios/axios#2107 @jeremymeng, as we changing to use node-fetch, it looks like the workaround is no more necessary, considering node-fetch brings override's semantic for content-length: https://github.com/node-fetch/node-fetch/blob/0936a9af0a049eb05897779f3f0df6b903a95d60/src/request.js#L237, what's your through? |
That's right we should remove the workaround for axios. |
We'll involve it in next GA version release. |
GA = "generally available" ? |
@thesiti92 Yes, we'll involved it in July milestone. Thanks, |
What's the workaround? |
Idt there is one? |
For now I'm saving the buffer into a temporal file and then uploading it. |
@damianmiranda-ge |
No easy workaround.
|
@thesiti92 FYI on @ljian3377 mentioned workaround. Thanks, |
Sounds good. Will try it out! Currently I'm just on v2 which works fine it's just not ideal |
Yes, v2 should work as well, feel free to let us know if there is any problem on the work around. And also we'll provide the fix in July release. |
Close as fix released. |
Describe the bug
I want to upload an image posted in an express route using the blob storage sdk. I end up getting the HMAC auth errors when i try to do so. I instead turned to making a test case and it turns out that i can post a plain text string in the route but not a string converted to a buffer, indicating that my credentials are correct, etc... The same string as buffer upload works when running separately in a node script. I'm trying to upgrade from v2 to v12 so fixing this is a big blocker.
To Reproduce
Here's my express router:
My Client initialization script
and the ts-node script that works fine:
Expected behavior
Image should upload fine and the console log should print
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I used azure logger as @ljian3377 suggested and the request from the node script and from the express server appear to be the same although it doesnt let me see the auth headers.
The text was updated successfully, but these errors were encountered: