Skip to content

Commit

Permalink
Log invalid CORS origin and method
Browse files Browse the repository at this point in the history
  • Loading branch information
sberyozkin committed Sep 15, 2023
1 parent b1a1196 commit dc226c9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public void handle(RoutingContext event) {
}
}
if (!allowsOrigin) {
LOG.debugf("Invalid origin %s", origin);
response.setStatusCode(403);
response.setStatusMessage("CORS Rejected - Invalid origin");
} else {
Expand Down Expand Up @@ -183,7 +184,7 @@ public void handle(RoutingContext event) {

//we check that the actual request matches the allowed methods and headers
if (!isMethodAllowed(request.method())) {
LOG.debug("Method is not allowed");
LOG.debugf("Method %s is not allowed", request.method());
response.setStatusCode(403);
response.setStatusMessage("CORS Rejected - Invalid method");
response.end();
Expand Down

0 comments on commit dc226c9

Please sign in to comment.