Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
5274cf24
Commit
5274cf24
authored
Mar 24, 2021
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.3.x' into 2.4.x
Closes gh-25784
parents
0043093a
130cc5b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
AbstractWebMvcEndpointHandlerMapping.java
...int/web/servlet/AbstractWebMvcEndpointHandlerMapping.java
+10
-7
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java
View file @
5274cf24
/*
* Copyright 2012-202
0
the original author or authors.
* Copyright 2012-202
1
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -53,9 +53,9 @@ import org.springframework.util.StringUtils;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseStatus
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.server.ResponseStatusException
;
import
org.springframework.web.servlet.HandlerMapping
;
import
org.springframework.web.servlet.handler.MatchableHandlerMapping
;
import
org.springframework.web.servlet.handler.RequestMatchResult
;
...
...
@@ -290,7 +290,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin
return
handleResult
(
this
.
operation
.
invoke
(
invocationContext
),
HttpMethod
.
resolve
(
request
.
getMethod
()));
}
catch
(
InvalidEndpointRequestException
ex
)
{
throw
new
BadOperationRequestException
(
ex
.
getReason
()
);
throw
new
InvalidEndpointBadRequestException
(
ex
);
}
}
...
...
@@ -401,11 +401,14 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin
}
@ResponseStatus
(
code
=
HttpStatus
.
BAD_REQUEST
)
private
static
class
BadOperationRequestException
extends
RuntimeException
{
/**
* Nested exception used to wrap a {@link InvalidEndpointRequestException} and provide
* a {@link HttpStatus#BAD_REQUEST} status.
*/
private
static
class
InvalidEndpointBadRequestException
extends
ResponseStatusException
{
BadOperationRequestException
(
String
messag
e
)
{
super
(
messag
e
);
InvalidEndpointBadRequestException
(
InvalidEndpointRequestException
caus
e
)
{
super
(
HttpStatus
.
BAD_REQUEST
,
cause
.
getReason
(),
caus
e
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment