Skip to content

Commit 221771e

Browse files
authored
Encode hash (#) in URL path (#33)
* encode hash in path * bump version and add NEWS
1 parent 0075366 commit 221771e

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: AzureGraph
22
Title: Simple Interface to 'Microsoft Graph'
3-
Version: 1.3.2
3+
Version: 1.3.3
44
Authors@R: c(
55
person("Hong", "Ooi", , "[email protected]", role = c("aut", "cre")),
66
person("Microsoft", role="cph")

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# AzureGraph 1.3.3
2+
3+
- Paths containing a hash (#) are encoded in `call_graph_endpoint()` and no longer fail with 404
4+
15
# AzureGraph 1.3.2
26

37
- Minor backend fixes.

R/call_graph.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ call_graph_endpoint <- function(token, operation, ..., options=list(),
3232
{
3333
url <- find_resource_host(token)
3434
url$path <- construct_path(api_version, operation)
35+
url$path <- encode_hash(url$path)
3536
url$query <- options
3637

3738
call_graph_url(token, url, ...)
@@ -138,6 +139,11 @@ construct_path <- function(...)
138139
sub("/$", "", file.path(..., fsep="/"))
139140
}
140141

142+
# paths containing hash need to be encoded
143+
encode_hash <- function(x)
144+
{
145+
gsub("#", "%23", x, fixed = TRUE)
146+
}
141147

142148
# display confirmation prompt, return TRUE/FALSE (no NA)
143149
get_confirmation <- function(msg, default=TRUE)

0 commit comments

Comments
 (0)