Skip to content

Commit

Permalink
Merge pull request #35959 from sberyozkin/cors_log_invalid_origin
Browse files Browse the repository at this point in the history
Log invalid CORS origin and method
  • Loading branch information
sberyozkin authored Sep 15, 2023
2 parents 86acd07 + dc226c9 commit d933be1
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 d933be1

Please sign in to comment.