Skip to content

Commit a4a4edf

Browse files
fix handling of null query in getPathAndQuery method (#2927)
1 parent 3e80e7a commit a4a4edf

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

core/src/main/java/com/predic8/membrane/core/resolver/RuleResolver.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ public InputStream resolve(String urlString) {
9494
}
9595
}
9696

97-
private static @NotNull String getPathAndQuery(URI uri) {
98-
if (uri.getQuery().isEmpty())
97+
private static @NotNull String getPathAndQuery(URI uri) {
98+
String query = uri.getQuery();
99+
if (query == null || query.isEmpty())
99100
return uri.getPath();
100-
return uri.getPath() + "?" + uri.getQuery();
101+
return uri.getPath() + "?" + query;
101102
}
102103

103104
protected static String getRuleName(String url) {

0 commit comments

Comments
 (0)