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
cf2b2df2
Commit
cf2b2df2
authored
May 15, 2014
by
Christian Dupuis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly decode URL coming into the Jolokia endpoint
fixes #869
parent
f65af2d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
JolokiaMvcEndpoint.java
...amework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java
+6
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java
View file @
cf2b2df2
...
@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.context.ServletContextAware
;
import
org.springframework.web.context.ServletContextAware
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.mvc.ServletWrappingController
;
import
org.springframework.web.servlet.mvc.ServletWrappingController
;
import
org.springframework.web.util.UrlPathHelper
;
/**
/**
* {@link MvcEndpoint} to expose Jolokia.
* {@link MvcEndpoint} to expose Jolokia.
...
@@ -124,15 +125,18 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
...
@@ -124,15 +125,18 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
private
static
class
PathStripper
extends
HttpServletRequestWrapper
{
private
static
class
PathStripper
extends
HttpServletRequestWrapper
{
private
final
String
path
;
private
final
String
path
;
private
final
UrlPathHelper
urlPathHelper
;
public
PathStripper
(
HttpServletRequest
request
,
String
path
)
{
public
PathStripper
(
HttpServletRequest
request
,
String
path
)
{
super
(
request
);
super
(
request
);
this
.
path
=
path
;
this
.
path
=
path
;
this
.
urlPathHelper
=
new
UrlPathHelper
();
}
}
@Override
@Override
public
String
getPathInfo
()
{
public
String
getPathInfo
()
{
String
value
=
super
.
getRequestURI
();
String
value
=
this
.
urlPathHelper
.
decodeRequestString
(
(
HttpServletRequest
)
getRequest
(),
super
.
getRequestURI
());
if
(
value
.
contains
(
this
.
path
))
{
if
(
value
.
contains
(
this
.
path
))
{
value
=
value
.
substring
(
value
.
indexOf
(
this
.
path
)
+
this
.
path
.
length
());
value
=
value
.
substring
(
value
.
indexOf
(
this
.
path
)
+
this
.
path
.
length
());
}
}
...
@@ -145,6 +149,6 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
...
@@ -145,6 +149,6 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
}
}
return
value
;
return
value
;
}
}
}
}
}
}
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