Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Network Health
Metrics
Onionoo
Commits
ff82fdaa
Commit
ff82fdaa
authored
Aug 20, 2018
by
Karsten Loesing
Browse files
Use parameterized map for parameters.
parent
ed9c9f34
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/torproject/onionoo/server/HttpServletRequestWrapper.java
View file @
ff82fdaa
...
...
@@ -20,8 +20,7 @@ public class HttpServletRequestWrapper {
return
this
.
request
.
getRequestURI
();
}
@SuppressWarnings
(
"rawtypes"
)
protected
Map
getParameterMap
()
{
protected
Map
<
String
,
String
[]>
getParameterMap
()
{
return
this
.
request
.
getParameterMap
();
}
...
...
src/main/java/org/torproject/onionoo/server/ResourceServlet.java
View file @
ff82fdaa
...
...
@@ -133,10 +133,10 @@ public class ResourceServlet extends HttpServlet {
/* Extract parameters either from the old-style URI or from request
* parameters. */
Map
<
String
,
String
>
parameterMap
=
new
HashMap
<>();
for
(
Object
parameterKey
:
request
.
getParameterMap
().
keySet
())
{
for
(
String
parameterKey
:
request
.
getParameterMap
().
keySet
())
{
String
[]
parameterValues
=
request
.
getParameterValues
(
(
String
)
parameterKey
);
parameterMap
.
put
(
(
String
)
parameterKey
,
parameterValues
[
0
]);
request
.
getParameterValues
(
parameterKey
);
parameterMap
.
put
(
parameterKey
,
parameterValues
[
0
]);
}
/* Make sure that the request doesn't contain any unknown
...
...
src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
View file @
ff82fdaa
...
...
@@ -64,8 +64,7 @@ public class ResourceServletTest {
return
this
.
requestUri
;
}
@SuppressWarnings
(
"rawtypes"
)
protected
Map
getParameterMap
()
{
protected
Map
<
String
,
String
[]>
getParameterMap
()
{
return
this
.
parameterMap
;
}
...
...
Write
Preview
Supports
Markdown
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