Skip to content

Commit

Permalink
changes to fix issue microsoft#90
Browse files Browse the repository at this point in the history
Use HTTPS when communicating with Storage API
  • Loading branch information
algattik committed Jul 25, 2017
1 parent 27d2cb7 commit 07d35d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions R/AzureBlob.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions R/AzureContainer.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 07d35d2

Please sign in to comment.