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
2f9859f2
Commit
2f9859f2
authored
May 18, 2022
by
Hiro
🏄
Browse files
Make that contact field does not contain strange characters that break the service
parent
6e404499
Pipeline
#39005
failed with stage
in 1 minute and 43 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/torproject/metrics/onionoo/docs/DetailsDocument.java
View file @
2f9859f2
...
...
@@ -423,6 +423,9 @@ public class DetailsDocument extends Document {
private
String
contact
;
public
void
setContact
(
String
contact
)
{
if
((
contact
!=
null
)
&&
(
contact
.
indexOf
(
'%'
)
!=
-
1
))
{
contact
=
contact
.
replace
(
"%"
,
"%%"
);
}
this
.
contact
=
escapeJson
(
contact
);
}
...
...
src/main/java/org/torproject/metrics/onionoo/docs/DetailsStatus.java
View file @
2f9859f2
...
...
@@ -128,6 +128,9 @@ public class DetailsStatus extends Document {
private
String
contact
;
public
void
setContact
(
String
contact
)
{
if
((
contact
!=
null
)
&&
(
contact
.
indexOf
(
'%'
)
!=
-
1
))
{
contact
=
contact
.
replace
(
"%"
,
"%%"
);
}
this
.
contact
=
escapeJson
(
contact
);
}
...
...
src/main/java/org/torproject/metrics/onionoo/server/ResponseBuilder.java
View file @
2f9859f2
...
...
@@ -180,9 +180,6 @@ public class ResponseBuilder {
}
private
void
write
(
PrintWriter
pw
,
String
format
,
Object
...
args
)
{
if
(
format
.
indexOf
(
'%'
)
!=
-
1
)
{
format
=
format
.
replace
(
"%"
,
"%%"
);
}
String
stringToWrite
=
String
.
format
(
format
,
args
);
this
.
charsWritten
+=
stringToWrite
.
length
();
pw
.
write
(
stringToWrite
);
...
...
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