Skip to content

Commit 063d2ef

Browse files
committed
- fixes #196 a bug where delta tokens would not be extracted properly
1 parent 29377df commit 063d2ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/microsoft/graph/http/BaseDeltaCollectionRequest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ protected void addDeltaTokenOption(@Nonnull final String value, @Nonnull final S
8181
* ?token=thetoken (onedrive)
8282
* delta(token='thetoken') (formal OData function usage)
8383
*/
84-
private static Pattern pattern = Pattern.compile("(?i)(?>\\$?delta)?token=['\"]?([\\w-\\.]+)");
84+
private static Pattern pattern = Pattern.compile("(?>[$]?delta)?token=['\"]?([\\w\\-\\.]+)", Pattern.CASE_INSENSITIVE);
8585
/**
8686
* Gets the delta token from the delta link provided by the previous response
8787
* @param deltaLink the delta link provided by the previous request
@@ -91,9 +91,9 @@ protected void addDeltaTokenOption(@Nonnull final String value, @Nonnull final S
9191
protected String getDeltaTokenFromLink(@Nonnull final String deltaLink) {
9292
Objects.requireNonNull(deltaLink, "parameter deltaLink cannot be null");
9393
final Matcher matcher = pattern.matcher(deltaLink);
94-
if(matcher.matches()) {
94+
if(matcher.find()) {
9595
return matcher.group(1);
9696
}
97-
return "";
97+
return "";
9898
}
9999
}

0 commit comments

Comments
 (0)