_decode_body fails if body is empty
Mr0grog opened this issue · 0 comments
Mr0grog commented
Sentry logged a fun divide by zero error today: https://sentry.io/environmental-data-governance-/diffing-server/issues/755564118/
Basically, in the diffing server’s _decode_body
method, we try to determine if a body might have been binary by determining the ratio of encoding errors to the length of the entire byte stream. However, if the byte stream was 0-length, that obviously won’t work too well (see line 318):
web-monitoring-processing/web_monitoring/diffing_server.py
Lines 313 to 320 in eab7e95
This should be a pretty straightforward fix and might pair well with #310.