GNServer 0.0.0.0.3__py3-none-any.whl → 0.0.0.0.5__py3-none-any.whl
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.
- GNServer/_app.py +4 -4
- {gnserver-0.0.0.0.3.dist-info → gnserver-0.0.0.0.5.dist-info}/METADATA +1 -1
- gnserver-0.0.0.0.5.dist-info/RECORD +7 -0
- gnserver-0.0.0.0.3.dist-info/RECORD +0 -7
- {gnserver-0.0.0.0.3.dist-info → gnserver-0.0.0.0.5.dist-info}/WHEEL +0 -0
- {gnserver-0.0.0.0.3.dist-info → gnserver-0.0.0.0.5.dist-info}/licenses/LICENSE +0 -0
- {gnserver-0.0.0.0.3.dist-info → gnserver-0.0.0.0.5.dist-info}/top_level.txt +0 -0
GNServer/_app.py
CHANGED
@@ -278,13 +278,13 @@ class App:
|
|
278
278
|
|
279
279
|
|
280
280
|
def static(self, path: str, dir_path: str):
|
281
|
-
@self.get(f"
|
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(
|
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()}')
|
@@ -0,0 +1,7 @@
|
|
1
|
+
GNServer/__init__.py,sha256=T6kT6WoJpmIXashMSHfuafb9DSePUIzw192h27j9a4M,1364
|
2
|
+
GNServer/_app.py,sha256=sLQwfXmEbMCpRulSVVqUGC5-4jdSQmtDD5JWWhsgXQs,17169
|
3
|
+
gnserver-0.0.0.0.5.dist-info/licenses/LICENSE,sha256=WH_t7dKZyWJ5Ld07eYIkUG4Tv6zZWXtAdsUqYAUesn0,1084
|
4
|
+
gnserver-0.0.0.0.5.dist-info/METADATA,sha256=uEYN3KzhtTxDmRKKNFMo2LYVIZu4O5BnL8BEPubn9KQ,804
|
5
|
+
gnserver-0.0.0.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
+
gnserver-0.0.0.0.5.dist-info/top_level.txt,sha256=-UOUBuD4u7Qkb1o5PdcwyA3kx8xCH2lwy0tJHi26Wb4,9
|
7
|
+
gnserver-0.0.0.0.5.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
GNServer/__init__.py,sha256=T6kT6WoJpmIXashMSHfuafb9DSePUIzw192h27j9a4M,1364
|
2
|
-
GNServer/_app.py,sha256=dCV8vs3eWna4QbF2WpNYsDROZTIf1LJIZrYXUyxEomg,17116
|
3
|
-
gnserver-0.0.0.0.3.dist-info/licenses/LICENSE,sha256=WH_t7dKZyWJ5Ld07eYIkUG4Tv6zZWXtAdsUqYAUesn0,1084
|
4
|
-
gnserver-0.0.0.0.3.dist-info/METADATA,sha256=F2nrEBBzvO2H173MvRZVZ-zC4J_e1LFyzqdAM5d6LGc,804
|
5
|
-
gnserver-0.0.0.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
-
gnserver-0.0.0.0.3.dist-info/top_level.txt,sha256=-UOUBuD4u7Qkb1o5PdcwyA3kx8xCH2lwy0tJHi26Wb4,9
|
7
|
-
gnserver-0.0.0.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|