 Weilbyte
					
					4 years ago
						Weilbyte
					
					4 years ago
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: E1EB2BFCF73B5B9F
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
7 additions and 
1 deletions
			 
			
		 
		
			
				- 
					
					
					 
					PVEDiscordDark/serve.py
				
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -37,12 +37,18 @@ class Server(BaseHTTPRequestHandler): | 
			
		
	
		
		
			
				
					|  |  |         elif ext == "js": |  |  |         elif ext == "js": | 
			
		
	
		
		
			
				
					|  |  |             data = open(os.path.join(DIR_JS, "PVEDiscordDark.js"), "rb").read() |  |  |             data = open(os.path.join(DIR_JS, "PVEDiscordDark.js"), "rb").read() | 
			
		
	
		
		
			
				
					|  |  |             type = "application/javascript" |  |  |             type = "application/javascript" | 
			
		
	
		
		
			
				
					
					|  |  |         elif ext == "png" or ext == "jpg" or ext == "jpeg" or ext == "svg": |  |  |         elif ext == "png" or ext == "jpg" or ext == "jpeg": | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             try: |  |  |             try: | 
			
		
	
		
		
			
				
					|  |  |                 data = open(os.path.join(DIR_IMAGES, file), "rb").read() |  |  |                 data = open(os.path.join(DIR_IMAGES, file), "rb").read() | 
			
		
	
		
		
			
				
					|  |  |                 type = f"image/{ext}" |  |  |                 type = f"image/{ext}" | 
			
		
	
		
		
			
				
					|  |  |             except FileNotFoundError: |  |  |             except FileNotFoundError: | 
			
		
	
		
		
			
				
					|  |  |                 status = 404 |  |  |                 status = 404 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         elif ext == "svg": | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             try: | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 data = open(os.path.join(DIR_IMAGES, file), "rb").read() | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 type = f"image/svg+xml" | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             except FileNotFoundError: | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 status = 404 | 
			
		
	
		
		
			
				
					|  |  |         else: |  |  |         else: | 
			
		
	
		
		
			
				
					|  |  |             status = 400 |  |  |             status = 400 | 
			
		
	
		
		
			
				
					|  |  |         self._set_headers(status, type) |  |  |         self._set_headers(status, type) | 
			
		
	
	
		
		
			
				
					|  | 
 |