GNServer 0.0.0.0.3__tar.gz → 0.0.0.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -278,13 +278,13 @@ class App:
278
278
 
279
279
 
280
280
  def static(self, path: str, dir_path: str):
281
- @self.get(f"/{path}/{{_path:path}}")
281
+ @self.get(f"{path}/{{_path:path}}")
282
282
  async def r_static(_path: str):
283
283
  file_path = os.path.join(dir_path, _path)
284
284
  if not os.path.isfile(file_path):
285
285
  return gn.GNResponse('gn:backend:404')
286
286
 
287
- mime_type = guess_type(file_path)
287
+ mime_type = guess_type(file_path.split('/')[-1])
288
288
  async with aiofiles.open(file_path, "rb") as f:
289
289
  data = f.read()
290
290
 
@@ -415,7 +415,7 @@ class App:
415
415
 
416
416
 
417
417
  self._quic.send_stream_data(request.stream_id, response.serialize(3), end_stream=True)
418
- logger.debug(f'Отправлен на сервер ответ -> {response.command()} {response.payload if len(response.payload) < 200 else ''}')
418
+ logger.debug(f'Отправлен на сервер ответ -> {response.command()} {response.payload if response.payload and len((response.payload)) < 200 else ''}')
419
419
  self.transmit()
420
420
  except Exception as e:
421
421
  logger.error('GNServer: error\n' + traceback.format_exc())
@@ -446,7 +446,7 @@ class App:
446
446
  data = await file.read()
447
447
 
448
448
  payload.pop(ext_file)
449
- payload['files'] = [{'mime-type': guess_type(ext_file), 'data': data}]
449
+ payload['files'] = [{'mime-type': guess_type(ext_file_.split('/')[-1]), 'data': data}]
450
450
  except Exception as e:
451
451
  payload[ext_file] = f'GNServer error: {e}'
452
452
  logger.debug(f'error resolving extra response -> {traceback.format_exc()}')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GNServer
3
- Version: 0.0.0.0.3
3
+ Version: 0.0.0.0.5
4
4
  Summary: GNServer
5
5
  Home-page: https://github.com/KeyisB/libs/tree/main/GNServer
6
6
  Author: KeyisB
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GNServer
3
- Version: 0.0.0.0.3
3
+ Version: 0.0.0.0.5
4
4
  Summary: GNServer
5
5
  Home-page: https://github.com/KeyisB/libs/tree/main/GNServer
6
6
  Author: KeyisB
@@ -5,7 +5,7 @@ filesName = 'GNServer'
5
5
 
6
6
  setup(
7
7
  name=name,
8
- version='0.0.0.0.3',
8
+ version='0.0.0.0.5',
9
9
  author="KeyisB",
10
10
  author_email="keyisb.pip@gmail.com",
11
11
  description=name,
File without changes
File without changes
File without changes