This commit is contained in:
anthorob committed 2021-09-21 13:43:11 -04:00
1 parent 7291ffc0a1
commit 62fe015ffa
2 files changed
+11 -4

No files matched your search

+2 -2
View File
@@ -67,9 +67,9 @@
</build>
<repositories>
<repository> <!-- This repo fixes issues with transitive dependencies -->
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
@@ -15,7 +15,9 @@ import java.io.OutputStream;
public class ActionHandler implements HttpHandler {
@Override
public void handle(HttpExchange exchange) throws IOException {
public void handle(HttpExchange exchange) {
try {
String path = exchange.getRequestURI().getRawPath();
if (path.equals("/actions/shutdown")) {
@@ -24,12 +26,17 @@ public class ActionHandler implements HttpHandler {
OutputStream os = exchange.getResponseBody();
os.write("Shutting down..".getBytes());
os.close();
MusicBot.shutdown();
//MusicBot.shutdown();
return;
}
exchange.sendResponseHeaders(200, path.length());
OutputStream os = exchange.getResponseBody();
os.write(path.getBytes());
os.close();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}