We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5ed72c commit 68583dcCopy full SHA for 68583dc
main.py
@@ -1,17 +1,18 @@
1
+import deflate
2
import gc
3
+import io
4
import json
5
import machine
6
import time
7
import uasyncio
-import zlib
8
9
from nanoweb.nanoweb import Nanoweb
10
11
import wifi
12
from tepra import Tepra, new_logger
13
from typ1ng import Optional, Tuple
14
-__version__ = '1.0.0'
15
+__version__ = '2.0.0'
16
17
18
class Print:
@@ -162,7 +163,8 @@ async def handle_prints(req):
162
163
164
zl = await req.read(int(content_len))
165
log('read from request body: {} bytes', len(zl))
- body = zlib.decompress(zl)
166
+ with deflate.DeflateIO(io.BytesIO(zl), deflate.ZLIB) as d:
167
+ body = d.read()
168
log('decompressed: {} bytes', len(body))
169
170
success, reason = t.print(body, depth)
0 commit comments