Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yannick Schinko
Dynmap-Multiserver
Commits
2aaecce1
Verified
Commit
2aaecce1
authored
Jan 27, 2021
by
Yannick Schinko
Browse files
Don't force index.html in URL
parent
a56e9d1d
Pipeline
#403
passed with stages
in 1 minute and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/cubespace/dynmap/multiserver/HTTP/Handler/StaticFileHandler.java
View file @
2aaecce1
...
...
@@ -26,15 +26,16 @@ public class StaticFileHandler implements IHandler {
@Override
public
void
handle
(
ChannelHandlerContext
ctx
,
FullHttpRequest
request
)
throws
Exception
{
//Check for index
final
String
path
=
webDir
+
File
.
separator
+
request
.
uri
();
String
path
=
webDir
+
File
.
separator
+
request
.
uri
();
final
String
uri
=
request
.
uri
();
//Check for index
if
(
uri
.
endsWith
(
"/"
))
{
for
(
String
index
:
indexFiles
)
{
File
checkFile
=
new
File
(
path
,
index
);
if
(
checkFile
.
exists
())
{
HandlerUtil
.
sendRedirect
(
ctx
,
uri
+
index
);
re
turn
;
path
=
checkFile
.
toString
(
);
b
re
ak
;
}
}
}
...
...
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