Skip to content
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

getBlobProperties throws when using failing IF_MODIFIED_SINCE access condition #77

Closed
jcookems opened this issue May 17, 2012 · 2 comments

Comments

@jcookems
Copy link
Contributor

This code fails with a null pointer exception:

service.getBlobProperties(container, blob, metadata,
    new GetBlobPropertiesOptions()
        .setAccessCondition(AccessCondition.ifModifiedSince(currentLastModifiedDate));

The reason is that the service returns a 304 code (NotModified), which is an exceptional condition, but processing continues regardless. The fix is to add the following code to BlobRestProxy.getBlobPropertiesResultFromResponse:

    ThrowIfNotSuccess(response);

This will throw a new ServiceException, which is more actionable by calling code.

@gcheng
Copy link

gcheng commented Jul 10, 2012

we should have unit test for this.

@ghost ghost assigned gcheng Jul 13, 2012
@gcheng
Copy link

gcheng commented Jul 25, 2012

fix ready!

gcheng pushed a commit to gcheng/azure-sdk-for-java that referenced this issue Jul 25, 2012

Verified

This commit was signed with the committer’s verified signature.
modified since condition is not met.
gcheng pushed a commit to gcheng/azure-sdk-for-java that referenced this issue Jul 27, 2012
issure Azure#77, let get blob properties throws an exception when the if
@gcheng gcheng closed this as completed Aug 7, 2012
joostdenijs pushed a commit to joostdenijs/azure-sdk-for-java that referenced this issue Jan 18, 2013
joostdenijs pushed a commit to joostdenijs/azure-sdk-for-java that referenced this issue Jan 18, 2013
fix the minor javadoc udpate for media service
jianghaolu pushed a commit to jianghaolu/azure-sdk-for-java that referenced this issue Apr 5, 2017
g2vinay pushed a commit to g2vinay/azure-sdk-for-java that referenced this issue Mar 4, 2019
Removed request encryption check from Set Tier API
g2vinay pushed a commit to g2vinay/azure-sdk-for-java that referenced this issue May 30, 2019
[Snyk] Fix for 3 vulnerable dependencies
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants