-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Receiving 403 AuthenticationFailed error instead of 400 Bad-Request! #14797
Comments
Thanks a lot for reporting this to us. This issue may because: the SDK uses content length in header to do signature, while storage service uses the actual content length for request body. We will fix this. Does this issue blocks your scenario? Do you have a work around? Thanks |
Currently, this acts as a blocker and we don't have a workaround. Thanks |
Do you need a released package, or a fix in master branch code also works for you? Thanks |
Hi @ralphie97 My proposed fix is to set the Content-Length as the actual length of the body, which won't cause 403 or 400 error because of the mismatch content length. Does this fix work for your solution? Thanks |
A released package will suffice. And regarding the fix, what should be expected if the content-length provided doesn't match the body-length. Does the body gets truncated? Thanks |
If the content-length provided doesn't match the body-length, we would propose to set value of content-length as body-length. This way, the uploading request will succeed. Thanks |
What if the content-length provided is smaller than the actual body-length? |
The SDK won't truncate request. Our proposal is to try to set the content-length to the correct value (actual body length), no matter whether content length is larger/smaller than actual body length. What do you think? Thanks |
That seems fine. Thanks |
[Hub Generated] Review request for Microsoft.HybridCompute to add version preview/2021-06-10-preview (Azure#14797) * Adds base for updating Microsoft.HybridCompute from version preview/2021-05-17-preview to version 2021-06-10-preview * Updates readme * Updates API version in new specs and examples * updated the swagger * added the missing bracket * removed type object * removed PatchSettings ref * used x-ms-client-flatten * fixed an issue * added osProfile to the machineUpdateProperties * removed the extra space * fixed by npm run prettier
Describe the bug
For uploadPages and appendBlock operations, if the contentLength doesn't match the actual length of the body we get 403 AuthenticationFailed error. This seems like a Bad request payload and thus should have given 400.
Hence we cannot differentiate between Permission-related error and the Bad-Request error, in case of the above-mentioned operations.
To Reproduce
Steps to reproduce the behavior:
Below is the sample code for appendBlock:
Expected behavior
Since we are providing an incorrect payload, we should receive a Bad-Request error with 400 statusCode.
The text was updated successfully, but these errors were encountered: