From 2ce3fbc6525cd8c1ddd060c54f833c5b6a2623c7 Mon Sep 17 00:00:00 2001 From: developomp Date: Wed, 20 Oct 2021 09:13:22 +0900 Subject: prettier formatted /api --- api/src/util/ipAddress.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'api/src/util') diff --git a/api/src/util/ipAddress.ts b/api/src/util/ipAddress.ts index c6239426..13cc9603 100644 --- a/api/src/util/ipAddress.ts +++ b/api/src/util/ipAddress.ts @@ -81,18 +81,15 @@ export function getIpAdress(req: Request): string { return req.headers[Config.get().security.forwadedFor] || req.socket.remoteAddress; } - export function distanceBetweenLocations(loc1: any, loc2: any): number { return distanceBetweenCoords(loc1.latitude, loc1.longitude, loc2.latitude, loc2.longitude); } //Haversine function function distanceBetweenCoords(lat1: number, lon1: number, lat2: number, lon2: number) { - const p = 0.017453292519943295; // Math.PI / 180 + const p = 0.017453292519943295; // Math.PI / 180 const c = Math.cos; - const a = 0.5 - c((lat2 - lat1) * p) / 2 + - c(lat1 * p) * c(lat2 * p) * - (1 - c((lon2 - lon1) * p)) / 2; + const a = 0.5 - c((lat2 - lat1) * p) / 2 + (c(lat1 * p) * c(lat2 * p) * (1 - c((lon2 - lon1) * p))) / 2; return 12742 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km -} \ No newline at end of file +} -- cgit 1.5.1 From 6593b03685fddf38140b8e60486f519768f52fe3 Mon Sep 17 00:00:00 2001 From: RiversideRocks <59586759+RiversideRocks@users.noreply.github.com> Date: Thu, 21 Oct 2021 12:45:10 -0400 Subject: Change user agent --- api/src/util/Message.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/src/util') diff --git a/api/src/util/Message.ts b/api/src/util/Message.ts index 789178b6..4ba93edd 100644 --- a/api/src/util/Message.ts +++ b/api/src/util/Message.ts @@ -33,7 +33,7 @@ const DEFAULT_FETCH_OPTIONS: any = { redirect: "follow", follow: 1, headers: { - "user-agent": "Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)" + "user-agent": "Mozilla/5.0 (compatible; Fosscord/1.0; +https://github.com/fosscord/fosscord)" }, size: 1024 * 1024 * 1, compress: true, -- cgit 1.5.1