Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
Openfire
Commits
a0cbf5f4
Commit
a0cbf5f4
authored
Mar 07, 2016
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #556 from guusdk/OF-1105
OF-1105: Plugin servlet mapping should be case insensitive.
parents
25f2eba6
f902de50
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
PluginServlet.java
...va/org/jivesoftware/openfire/container/PluginServlet.java
+7
-7
No files found.
src/java/org/jivesoftware/openfire/container/PluginServlet.java
View file @
a0cbf5f4
...
...
@@ -74,7 +74,7 @@ public class PluginServlet extends HttpServlet {
private
static
final
Logger
Log
=
LoggerFactory
.
getLogger
(
PluginServlet
.
class
);
private
static
Map
<
String
,
GenericServlet
>
servlets
;
private
static
Map
<
String
,
GenericServlet
>
servlets
;
// mapped using lowercase path (OF-1105)
private
static
PluginManager
pluginManager
;
private
static
ServletConfig
servletConfig
;
...
...
@@ -179,7 +179,7 @@ public class PluginServlet extends HttpServlet {
if
(
instance
instanceof
GenericServlet
)
{
// Initialize the servlet then add it to the map..
((
GenericServlet
)
instance
).
init
(
servletConfig
);
servlets
.
put
(
pluginName
+
url
,
(
GenericServlet
)
instance
);
servlets
.
put
(
(
pluginName
+
url
).
toLowerCase
()
,
(
GenericServlet
)
instance
);
}
else
{
Log
.
warn
(
"Could not load "
+
(
pluginName
+
url
)
+
": not a servlet."
);
...
...
@@ -217,11 +217,11 @@ public class PluginServlet extends HttpServlet {
Element
nameElement
=
(
Element
)
names
.
get
(
i
);
String
url
=
nameElement
.
element
(
"url-pattern"
).
getTextTrim
();
// Destroy the servlet than remove from servlets map.
GenericServlet
servlet
=
servlets
.
get
(
pluginName
+
url
);
GenericServlet
servlet
=
servlets
.
get
(
(
pluginName
+
url
).
toLowerCase
()
);
if
(
servlet
!=
null
)
{
servlet
.
destroy
();
}
servlets
.
remove
(
pluginName
+
url
);
servlets
.
remove
(
(
pluginName
+
url
).
toLowerCase
()
);
servlet
=
null
;
}
}
...
...
@@ -251,7 +251,7 @@ public class PluginServlet extends HttpServlet {
throw
new
ServletException
(
"Servlet is missing"
);
}
String
pluginServletUrl
=
pluginName
+
relativeUrl
;
servlets
.
put
(
pluginName
+
relativeUrl
,
servlet
);
servlets
.
put
(
(
pluginName
+
relativeUrl
).
toLowerCase
()
,
servlet
);
return
PLUGINS_WEBROOT
+
pluginServletUrl
;
}
...
...
@@ -271,7 +271,7 @@ public class PluginServlet extends HttpServlet {
throw
new
ServletException
(
"Servlet URL is missing"
);
}
String
fullUrl
=
pluginName
+
url
;
GenericServlet
servlet
=
servlets
.
remove
(
fullUrl
);
GenericServlet
servlet
=
servlets
.
remove
(
fullUrl
.
toLowerCase
()
);
return
servlet
;
}
...
...
@@ -291,7 +291,7 @@ public class PluginServlet extends HttpServlet {
// Strip the starting "/" from the path to find the JSP URL.
String
jspURL
=
pathInfo
.
substring
(
1
);
GenericServlet
servlet
=
servlets
.
get
(
jspURL
);
GenericServlet
servlet
=
servlets
.
get
(
jspURL
.
toLowerCase
()
);
if
(
servlet
!=
null
)
{
servlet
.
service
(
request
,
response
);
}
...
...
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