mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-22 18:32:29 +01:00
Close #954
This commit is contained in:
parent
4db83ee531
commit
5f553cc614
@ -84,6 +84,25 @@ export class FosscordServer extends Server {
|
||||
);
|
||||
}
|
||||
|
||||
// Discord.com sends ISO strings with +00:00 extension, not Z
|
||||
// This causes issues with Python bot libs
|
||||
this.app.set(
|
||||
"json replacer",
|
||||
function (
|
||||
this: { [key: string]: unknown },
|
||||
key: string,
|
||||
value: unknown,
|
||||
) {
|
||||
if (this[key] instanceof Date) {
|
||||
return (this[key] as Date)
|
||||
.toISOString()
|
||||
.replace("Z", "+00:00");
|
||||
}
|
||||
|
||||
return value;
|
||||
},
|
||||
);
|
||||
|
||||
this.app.use(CORS);
|
||||
this.app.use(BodyParser({ inflate: true, limit: "10mb" }));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user