Severity: Low (5 RTC)
Description
The Flask proxy at server_proxy.py unconditionally calls response.json() on the upstream response. If the upstream (localhost:8088) returns non-JSON (e.g., HTML error page, plain text), response.json() raises JSONDecodeError and the proxy returns a 500, obscuring the original error.
Code location
# server_proxy.py
@app.route('/api/<path:path>', methods=['GET', 'POST'])
def proxy(path):
...
resp = requests.post(url, ...) # or get
return resp.json(), resp.status_code # <-- unsafe
Impact
- Proxy hides upstream errors
- Crashes when upstream returns non-JSON (e.g., 500 HTML)
Fix
Check Content-Type header before parsing JSON; fall back to resp.text and set Content-Type accordingly.
Bug report for bounty #305. Wallet: RTC3fcd93a4ec68cfd6b59d1b41c4872c5c239c4ad8
Severity: Low (5 RTC)
Description
The Flask proxy at
server_proxy.pyunconditionally callsresponse.json()on the upstream response. If the upstream (localhost:8088) returns non-JSON (e.g., HTML error page, plain text),response.json()raisesJSONDecodeErrorand the proxy returns a 500, obscuring the original error.Code location
Impact
Fix
Check
Content-Typeheader before parsing JSON; fall back toresp.textand setContent-Typeaccordingly.Bug report for bounty #305. Wallet: RTC3fcd93a4ec68cfd6b59d1b41c4872c5c239c4ad8