From dbb7b6b6e4d5ebd0287c49700a85cc585f62e0e3 Mon Sep 17 00:00:00 2001 From: Zamil Majdy Date: Mon, 20 Sep 2021 11:42:46 +0200 Subject: [PATCH] Fixed on reading un-encoded copy-source header field --- .../src/com/microsoft/azure/storage/blob/BlobResponse.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/microsoft-azure-storage/src/com/microsoft/azure/storage/blob/BlobResponse.java b/microsoft-azure-storage/src/com/microsoft/azure/storage/blob/BlobResponse.java index be27a551c..e05f114ac 100644 --- a/microsoft-azure-storage/src/com/microsoft/azure/storage/blob/BlobResponse.java +++ b/microsoft-azure-storage/src/com/microsoft/azure/storage/blob/BlobResponse.java @@ -59,7 +59,7 @@ public static String getAcl(final HttpURLConnection request) { * @throws URISyntaxException */ public static BlobAttributes getBlobAttributes(final HttpURLConnection request, final StorageUri resourceURI, - final String snapshotID) throws URISyntaxException, ParseException { + final String snapshotID) throws URISyntaxException, ParseException, StorageException { final String blobType = request.getHeaderField(BlobConstants.BLOB_TYPE_HEADER); final BlobAttributes attributes = new BlobAttributes(BlobType.parse(blobType)); @@ -268,7 +268,7 @@ public static AccountInformation getAccountInformation(final HttpURLConnection r * @throws URISyntaxException * @throws ParseException */ - public static CopyState getCopyState(final HttpURLConnection request) throws URISyntaxException, ParseException { + public static CopyState getCopyState(final HttpURLConnection request) throws URISyntaxException, ParseException, StorageException { String copyStatusString = request.getHeaderField(Constants.HeaderConstants.COPY_STATUS); if (!Utility.isNullOrEmpty(copyStatusString)) { final CopyState copyState = new CopyState(); @@ -286,7 +286,7 @@ public static CopyState getCopyState(final HttpURLConnection request) throws URI final String copySourceString = request.getHeaderField(Constants.HeaderConstants.COPY_SOURCE); if (!Utility.isNullOrEmpty(copySourceString)) { - copyState.setSource(new URI(copySourceString)); + copyState.setSource(new URI(Utility.safeEncode(copySourceString))); } final String copyCompletionTimeString =