Skip to content

Commit 847e6ff

Browse files
author
Dave Syer
committed
Add explicit handler for HttpRequestMethodNotSupportedException
Fixes spring-atticgh-408
1 parent cbe00d2 commit 847e6ff

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/endpoint/TokenEndpoint.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ protected String getClientId(Principal principal) {
155155
return clientId;
156156
}
157157

158+
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
159+
public void handleHttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e) throws Exception {
160+
logger.info("Handling error: " + e.getClass().getSimpleName() + ", " + e.getMessage());
161+
throw e;
162+
}
163+
158164
@ExceptionHandler(Exception.class)
159165
public ResponseEntity<OAuth2Exception> handleException(Exception e) throws Exception {
160166
logger.info("Handling error: " + e.getClass().getSimpleName() + ", " + e.getMessage());

tests/annotation/jwt/src/main/resources/application.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ management:
66
security:
77
user:
88
password: password
9+
logging:
10+
level:
11+
org.springframework.security: DEBUG

tests/annotation/jwt/src/main/resources/logback.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)