summary refs log tree commit diff
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-07-31 13:27:15 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-07-31 15:01:19 +0200
commit6e9bd98711f488dd06d2ce93027f8d9ea4cd3ad5 (patch)
tree8a37ed24e9181b6f464974a884a6087d306137ec
parentAdd local disk caching for fetched assets (diff)
downloadserver-6e9bd98711f488dd06d2ce93027f8d9ea4cd3ad5.tar.xz
Make requested changes (pr792)
-rw-r--r--.gitignore2
-rw-r--r--api/src/middlewares/TestClient.ts1
-rw-r--r--api/src/util/entities/AssetCacheItem.ts15
-rw-r--r--fosscord-server.code-workspace6
4 files changed, 4 insertions, 20 deletions
diff --git a/.gitignore b/.gitignore
index cc60b305..607b4f5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,5 @@ config.json
 .vscode/settings.json
 api/assets/plugins/*.js
 .idea/
+*.code-workspace
+
diff --git a/api/src/middlewares/TestClient.ts b/api/src/middlewares/TestClient.ts
index e52a5e59..7292868c 100644
--- a/api/src/middlewares/TestClient.ts
+++ b/api/src/middlewares/TestClient.ts
@@ -27,7 +27,6 @@ export default function TestClient(app: Application) {
 		newAssetCache = new Map<string, AssetCacheItem>(Object.entries(JSON.parse(rawdata.toString())));
 	}
 
-	//define routes
 	app.use("/assets", express.static(path.join(__dirname, "..", "..", "assets")));	
 	app.get("/assets/:file", async (req: Request, res: Response) => {
 		delete req.headers.host;
diff --git a/api/src/util/entities/AssetCacheItem.ts b/api/src/util/entities/AssetCacheItem.ts
index 7fb4e1e6..160dece6 100644
--- a/api/src/util/entities/AssetCacheItem.ts
+++ b/api/src/util/entities/AssetCacheItem.ts
@@ -1,16 +1,3 @@
-import { Headers } from "node-fetch";
-
 export class AssetCacheItem {
-	public Key: string;
-	public FilePath: string;
-	public Headers: any;
-
-	constructor(key: string){
-		this.Key = key;
-	}
-	/*constructor(key: string, filePath: string, headers: Headers) {
-		this.Key = key;
-		this.FilePath = filePath;
-		this.Headers = headers;
-	}*/
+	constructor(public Key: string, public FilePath: string = "", public Headers: any = null as any) {}
 }
\ No newline at end of file
diff --git a/fosscord-server.code-workspace b/fosscord-server.code-workspace
index fff238f1..7491cb35 100644
--- a/fosscord-server.code-workspace
+++ b/fosscord-server.code-workspace
@@ -24,9 +24,5 @@
 		{
 			"path": "webrtc"
 		}
-	],
-	"settings": {
-		"awooga.originalColorCustomizations": {},
-		"workbench.colorCustomizations": {}
-	}
+	]
 }