Skip to content

Commit

Permalink
fix network status
Browse files Browse the repository at this point in the history
  • Loading branch information
XboxBedrock committed Jul 4, 2024
1 parent 7c717ca commit 8e161eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/status.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import MinecraftServerStatus from "../typings/MinecraftServerStatus.js"
import CommandMessage from "../struct/CommandMessage.js"

const API_URL = "https://api.mcsrvstat.us/2/"
const JAVA_URL = `${API_URL}network.buildtheearth.net`
const JAVA_URL = `${API_URL}buildtheearth.net`
const BEDROCK_URL = `${API_URL}bedrock.buildtheearth.net`

export default new Command({
Expand Down
3 changes: 3 additions & 0 deletions src/struct/web/middleware/AuthProxy.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { Response, Request } from "express"
export default class AuthProxy implements NestMiddleware {
use(@Req() req: Request, @Res() res: Response, @Next() next: () => unknown): void {
const ip = req.headers["x-forwarded-for"]?.toString() || req.socket.remoteAddress
console.log(req.headers.authorization)

console.log(`Bearer ${globalThis.client.config.interKey}`)
if (req.headers.authorization == `Bearer ${globalThis.client.config.interKey}`) {
globalThis.client.logger.info(
`API ${req.method} request to ${req.url} from ${ip}`
Expand Down

0 comments on commit 8e161eb

Please sign in to comment.