-
Notifications
You must be signed in to change notification settings - Fork 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
Validate length of flux content matches with Content-Length header #4193
Labels
Azure.Core
azure-core
Client
This issue points to a problem in the data-plane of the library.
Storage
Storage Service (Queues, Blobs, Files)
Comments
anuchandy
added
the
Client
This issue points to a problem in the data-plane of the library.
label
Jun 29, 2019
When this validation fails throw /**
* Indicates that a stream emitted an unexpected number of bytes.
*/
public class UnexpectedLengthException extends IllegalStateException {
private final long bytesRead;
private final long bytesExpected;
/**
* Creates an UnexpectedLengthException.
* @param message the message
* @param bytesRead the number of bytes actually read in the stream
* @param bytesExpected the number of bytes expected to be read in the stream
*/
public UnexpectedLengthException(String message, long bytesRead, long bytesExpected) {
super(message);
this.bytesRead = bytesRead;
this.bytesExpected = bytesExpected;
}
/**
* @return the number of bytes actually read in the stream
*/
public long bytesRead() {
return bytesRead;
}
/**
* @return the number of bytes expected to be read in the stream
*/
public long bytesExpected() {
return bytesExpected;
}
} |
@joshfree this will unblock many Storage tests. |
19 tasks
Verified the current structure. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Azure.Core
azure-core
Client
This issue points to a problem in the data-plane of the library.
Storage
Storage Service (Queues, Blobs, Files)
Is your feature request related to a problem? Please describe.
Storage SDK has blob upload methods where user can provide flux emitting the content and length. The length become Content-Length header. A validation is missing that ensure length of data emitted by flux is equal to length param.
Describe the solution you'd like
instead of passing the flux to reactor-netty directly, append operators that does this check and pass updated flux to reactor-netty.
Describe alternatives you've considered
Adding this validation in storage SDK side is possible but with lot of code duplication since we have multiple upload methods.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: