Skip to content

Source access conditions not honored by BlobRestProxy.copyBlob #85

Description

@jcookems

Regardless of what source access conditions are provided in the options of CopyBlob, the calls succeed. This is because of an issue in PipelineHelpers.addOptionalSourceAccessContitionHeader, reproduced here:

            switch (accessCondition.getHeader()) {
                case IF_MATCH:
                    headerName = "x-ms-source-if-match";
                case IF_UNMODIFIED_SINCE:
                    headerName = "x-ms-source-if-unmodified-since";
                case IF_MODIFIED_SINCE:
                    headerName = "x-ms-source-if-modified-since";
                case IF_NONE_MATCH:
                    headerName = "x-ms-source-if-none-match";
                default:
                    headerName = "";
            }

The problem is that in Java, one case cascades into the next, so regardless of the value of the Header property, the headerName is always the empty string.

The fix is to add a break; statement at the end of each case block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions