Skip to content

Commit

Permalink
fix redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
JoCat committed Feb 23, 2024
1 parent 4d16358 commit 0db20f2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export class WebServerManager {
}

private redirectListener(req: http.IncomingMessage, res: http.ServerResponse) {
if (req.headers["user-agent"].startsWith("Java")) {
res.setHeader("X-Authlib-Injector-API-Location", "/authlib");
return res.end();
}

const { useSSL } = this.configManager.config.api;
res.writeHead(301, {
Location: `http${useSSL ? "s" : ""}://${req.headers.host}/files`,
Expand Down

0 comments on commit 0db20f2

Please sign in to comment.