mirror of
https://github.com/JonasunderscoreJones/McWebserver.git
synced 2025-10-22 10:59:18 +02:00
parent
54188d7c31
commit
0a71b04b66
1 changed files with 6 additions and 2 deletions
|
@ -123,8 +123,8 @@ public class HttpServer implements Runnable {
|
|||
while ((header = in.readLine()) != null && !header.isEmpty()) {
|
||||
|
||||
// Check if the header contains your API token
|
||||
if (header.startsWith("Authorization: Basic ")) {
|
||||
apiToken = header.substring("Authorization: Basic ".length());
|
||||
if (header.startsWith("Authorization: Bearer ")) {
|
||||
apiToken = header.substring("Authorization: Bearer ".length());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -350,6 +350,10 @@ public class HttpServer implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
/*private BufferedOutputStream responseConstructor(BufferedOutputStream dataOut, String content, String mimeType) {
|
||||
dataOut.write()
|
||||
}*/
|
||||
|
||||
private byte[] readFileData(Path file) throws IOException {
|
||||
return Files.readAllBytes(file);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue