Skip to content

Commit

Permalink
Merge pull request #816 from DyfanJones/anonymous_cred
Browse files Browse the repository at this point in the history
prevent headers being removed
  • Loading branch information
DyfanJones authored Aug 2, 2024
2 parents d5331a6 + 71a6e06 commit bbded65
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions paws.common/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# paws.common 0.7.5 (development)
* build endpoint with host_prefix (#804), thanks to @joseale2310 and @lyschoening for raising issue.
* fix `unix_time` ensure seconds is numeric (#804), thanks to @joseale2310 and @lyschoening for raising issue.
* fix stop anonymous credentials removing `x-amz-*` headers (#815) thanks to @cgostic for raising issue

# paws.common 0.7.4
* fix `transpose` to correctly parse lists with empty first elements (#791), thanks to @FMKerckhof for raising issue.
Expand Down
2 changes: 0 additions & 2 deletions paws.common/R/signer_v4.R
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ get_uri_path <- function(url) {
# Clear down headers for anonymous credentials
# https://github.com/aws/aws-sdk-go/blob/a7b02935e4fefa40f175f4d2143ec9c88a5f90f5/aws/signer/v4/v4_test.go#L321-L355
anonymous_headers <- function(headers) {
found <- grepl("X-Amz-*", names(headers))
headers[found] <- ""
headers["Authorization"] <- ""
return(headers)
}
2 changes: 0 additions & 2 deletions paws.common/tests/testthat/test_signer_v4.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,4 @@ test_that("Test anonymous credentials", {
res <- v4_sign_request_handler(req)

expect_equal(res$http_request$header[["Authorization"]], "")
expect_equal(res$http_request$header[["X-Amz-Date"]], "")
expect_equal(res$http_request$header[["X-Amz-Content-Sha256"]], "")
})

0 comments on commit bbded65

Please sign in to comment.