Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
99dbac8a
Commit
99dbac8a
authored
May 10, 2022
by
gentlespoon
Committed by
Melledy
May 10, 2022
Browse files
Add UTF8 charset in dispatch server HTML template.
parent
b1bd0a5a
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java
View file @
99dbac8a
...
...
@@ -252,14 +252,14 @@ public final class DispatchServer {
else
config
.
enableCorsForAllOrigins
();
}
});
httpServer
.
get
(
"/"
,
(
req
,
res
)
->
res
.
send
(
translate
(
"messages.status.welcome"
)));
httpServer
.
get
(
"/"
,
(
req
,
res
)
->
res
.
send
(
"<!doctype html><html><head><meta charset=\"utf8\"></head><body>"
+
translate
(
"messages.status.welcome"
)
+
"</body></html>"
));
httpServer
.
raw
().
error
(
404
,
ctx
->
{
if
(
Grasscutter
.
getConfig
().
DebugMode
==
ServerDebugMode
.
MISSING
)
{
Grasscutter
.
getLogger
().
info
(
translate
(
"messages.dispatch.unhandled_request_error"
,
ctx
.
method
(),
ctx
.
url
()));
}
ctx
.
contentType
(
"text/html"
);
ctx
.
result
(
"<!doctype html><html
lang=\"en\"
><body><img src=\"https://http.cat/404\" /></body></html>"
);
// I'm like 70% sure this won't break anything.
ctx
.
result
(
"<!doctype html><html
><head><meta charset=\"utf8\"></head
><body><img src=\"https://http.cat/404\" /></body></html>"
);
// I'm like 70% sure this won't break anything.
});
// Authentication Handler
...
...
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