feat: raw binary chunked upload (100KB), drop base64 form, bump 1.0.7→1.0.8
Deploy loadtest / validate (push) Waiting to run

This commit is contained in:
2026-07-10 23:16:13 +04:00
parent 3504711b98
commit c448299c9d
2 changed files with 64 additions and 105 deletions
+13 -10
View File
@@ -4,7 +4,7 @@ from flask import Flask, render_template, request
app = Flask(__name__)
VERSION = '1.0.7'
VERSION = '1.0.8'
@app.route('/')
@@ -34,15 +34,18 @@ def upload():
if missing:
data += '=' * (4 - missing)
raw = base64.b64decode(data)
elapsed = round((time.time() - t0) * 1000)
return {'ok': True, 'bytes': len(raw), 'elapsed_ms': elapsed}
# старый режим: файл напрямую (может не работать через DDOS-Guard)
for f in request.files.values():
while True:
chunk = f.read(8192)
if not chunk:
break
total += len(chunk)
total = len(raw)
# файловый режим
elif request.files:
for f in request.files.values():
while True:
chunk = f.read(8192)
if not chunk:
break
total += len(chunk)
# raw-режим: тело как есть
else:
total = len(request.get_data())
elapsed = round((time.time() - t0) * 1000)
return {'ok': True, 'bytes': total, 'elapsed_ms': elapsed}