Skip to content

Commit

Permalink
only allow GET requests if write-operations are not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Aug 4, 2023
1 parent 46ffac3 commit 6d4c266
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/cryostat/agent/remote/RecordingsContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ private void sendHeader(HttpExchange exchange, int status) {
}

private boolean ensureMethodAccepted(HttpExchange exchange) throws IOException {
Set<String> blocked = Set.of("POST");
Set<String> alwaysAllowed = Set.of("GET");
String mtd = exchange.getRequestMethod();
boolean restricted = blocked.contains(mtd);
boolean restricted = !alwaysAllowed.contains(mtd);
if (!restricted) {
return true;
}
Expand Down

0 comments on commit 6d4c266

Please sign in to comment.