From 07d35d258f78946d93411220262c2d7f6e919874 Mon Sep 17 00:00:00 2001 From: algattik Date: Tue, 25 Jul 2017 16:33:21 +0200 Subject: [PATCH] changes to fix issue #90 Use HTTPS when communicating with Storage API --- R/AzureBlob.R | 8 ++++---- R/AzureContainer.R | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/R/AzureBlob.R b/R/AzureBlob.R index 859245e..30416e4 100644 --- a/R/AzureBlob.R +++ b/R/AzureBlob.R @@ -34,7 +34,7 @@ azureListStorageBlobs <- function(azureActiveContext, storageAccount, storageKey verbosity <- set_verbosity(verbose) - URL <- paste0("http://", storageAccount, ".blob.core.windows.net/", container, "?restype=container&comp=list") + URL <- paste0("https://", storageAccount, ".blob.core.windows.net/", container, "?restype=container&comp=list") if (!missing(maxresults) && !is.null(maxresults)) URL <- paste0(URL, "&maxresults=", maxresults) if (!missing(prefix) && !is.null(prefix)) URL <- paste0(URL, "&prefix=", prefix) if (!missing(delimiter) && !is.null(delimiter)) URL <- paste0(URL, "&delimiter=", delimiter) @@ -237,7 +237,7 @@ azureGetBlob <- function(azureActiveContext, blob, directory, type = "text", blob <- gsub("^/", "", blob) blob <- gsub("^\\./", "", blob) - URL <- paste0("http://", storageAccount, ".blob.core.windows.net/", container, "/", blob) + URL <- paste0("https://", storageAccount, ".blob.core.windows.net/", container, "/", blob) r <- callAzureStorageApi(URL, storageKey = storageKey, storageAccount = storageAccount, container = container, CMD = paste0("/", blob) @@ -319,7 +319,7 @@ azurePutBlob <- function(azureActiveContext, blob, contents = "", file = "", storageKey <- refreshStorageKey(azureActiveContext, storageAccount, resourceGroup) } - URL <- paste0("http://", storageAccount, ".blob.core.windows.net/", container, "/", blob) + URL <- paste0("https://", storageAccount, ".blob.core.windows.net/", container, "/", blob) r <- callAzureStorageApi(URL, verb = "PUT", headers = "x-ms-blob-type:Blockblob", @@ -515,7 +515,7 @@ azureDeleteBlob <- function(azureActiveContext, blob, directory, blob <- gsub("^/", "", blob) blob <- gsub("^\\./", "", blob) - URL <- paste0("http://", storageAccount, ".blob.core.windows.net/", container, "/", blob) + URL <- paste0("https://", storageAccount, ".blob.core.windows.net/", container, "/", blob) xdate <- x_ms_date() SIG <- getSig(azureActiveContext, url = URL, verb = "DELETE", key = storageKey, diff --git a/R/AzureContainer.R b/R/AzureContainer.R index c6c4a7c..def4214 100644 --- a/R/AzureContainer.R +++ b/R/AzureContainer.R @@ -27,7 +27,7 @@ azureListStorageContainers <- function(azureActiveContext, storageAccount, stora verbosity <- set_verbosity(verbose) - URL <- paste0("http://", storageAccount, ".blob.core.windows.net/?comp=list") + URL <- paste0("https://", storageAccount, ".blob.core.windows.net/?comp=list") xdate <- x_ms_date() SIG <- getSig(azureActiveContext, url = URL, verb = "GET", key = storageKey, storageAccount = storageAccount, CMD = "\ncomp:list", date = xdate) @@ -110,7 +110,7 @@ azureCreateStorageContainer <- function(azureActiveContext, container, storageAc azureActiveContext$storageAccount <- storageAccount azureActiveContext$resourceGroup <- resourceGroup - URL <- paste0("http://", storageAccount, ".blob.core.windows.net/", container, "?restype=container") + URL <- paste0("https://", storageAccount, ".blob.core.windows.net/", container, "?restype=container") xdate <- x_ms_date() SIG <- getSig(azureActiveContext, url = URL, verb = "PUT", key = storageKey, storageAccount = storageAccount, container = container, @@ -172,7 +172,7 @@ azureDeleteStorageContainer <- function(azureActiveContext, container, storageAc } - URL <- paste0("http://", storageAccount, ".blob.core.windows.net/", container, "?restype=container") + URL <- paste0("https://", storageAccount, ".blob.core.windows.net/", container, "?restype=container") xdate <- x_ms_date() SIG <- getSig(azureActiveContext, url = URL, verb = "DELETE", key = storageKey, storageAccount = storageAccount,