fix body json+token #3
2
irc/makefile
Normal file
2
irc/makefile
Normal file
@ -0,0 +1,2 @@
|
||||
run:
|
||||
python miniircd.py --debug --ports 6699 --ssl-cert-file ..\static\certs\cert.pem --ssl-key-file ..\static\certs\key.pem
|
1288
irc/miniircd.py
Normal file
1288
irc/miniircd.py
Normal file
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,17 @@ const unknownEndpointHandler = (request: Request, response: Response) => {
|
||||
const requestLogger = (request: Request, _response: Response, next: NextFunction) => {
|
||||
console.log("Method:", request.method);
|
||||
console.log("Path: ", request.path);
|
||||
console.log("Body: ", request.body);
|
||||
if (Buffer.isBuffer(request.body)) {
|
||||
const str = request.body.toString();
|
||||
const index = str.lastIndexOf("}");
|
||||
const jsonSubstring = str.substring(0, index + 1);
|
||||
console.log("Body: ", jsonSubstring);
|
||||
request.body = jsonSubstring;
|
||||
if (str.length > jsonSubstring.length) {
|
||||
const token = str.substring(index + 1, str.length).trim();
|
||||
console.log("Token: ", token);
|
||||
}
|
||||
}
|
||||
console.log("---");
|
||||
next();
|
||||
};
|
||||
|
@ -28,6 +28,6 @@ export const NRS = ["104.237.145.11", "139.144.69.73", "170.187.231.80", "45.33.
|
||||
|
||||
export const DTLS = 99;
|
||||
|
||||
export const IRC = ["localhost"];
|
||||
export const IRC = ["localhost:6699"];
|
||||
|
||||
export const HUB = "https://arbiter.warframe.com/api/";
|
||||
|
Loading…
x
Reference in New Issue
Block a user