Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ public Response get(UriResource uriResource, Map<String, String> urlParams, IHTT
Map<String, String> queryParams = session.getParms();
if (queryParams.size() > 0) {
for (Map.Entry<String, String> entry : queryParams.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
String key = sanitise(entry.getKey());
String value = sanitise(entry.getValue());
text.append("<p>Param '");
text.append(key);
text.append("' = ");
Expand All @@ -175,6 +175,10 @@ public Response get(UriResource uriResource, Map<String, String> urlParams, IHTT
}
return Response.newFixedLengthResponse(getStatus(), getMimeType(), text.toString());
}

private String sanitise(String possibleCode) {
return org.apache.commons.text.StringEscapeUtils.escapeHtml4(possibleCode);
}
}

/**
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@
</plugins>
</reporting>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down