Skip to content

Commit 6696aec

Browse files
authored
Merge pull request #90 from microsoftgraph/feature/url-regex-replace-improvement
feature/url-regex-replace-improvement
2 parents d0fbb70 + 72df8da commit 6696aec

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/main/java/com/microsoft/graph/content/MSBatchRequestContent.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ private JsonObject getBatchRequestObjectFromRequestStep(final MSBatchRequestStep
118118
contentmap.add("id", new JsonPrimitive(batchRequestStep.getRequestId()));
119119

120120
final String url = batchRequestStep.getRequest().url().toString()
121-
.replaceAll("https://graph.microsoft.com/v1.0/", "").replaceAll("http://graph.microsoft.com/v1.0/", "")
122-
.replaceAll("https://graph.microsoft.com/beta/", "").replaceAll("http://graph.microsoft.com/beta/", "");
121+
.replaceAll("(?i)^http[s]?:\\/\\/graph\\.microsoft\\.com\\/(?>v1\\.0|beta)\\/?", ""); // (?i) case insensitive
123122
contentmap.add("url", new JsonPrimitive(url));
124123

125124
contentmap.add("method", new JsonPrimitive(batchRequestStep.getRequest().method().toString()));

0 commit comments

Comments
 (0)