authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-03 15:48:42-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-03 15:50:55-07:00
log0aa624e18fc10573360eaa261231e2c5ca0e9d30
tree13b9f58b7b3fc54423d2ea7e85f5b83f2f41edb1
parent8e66d05cf42adad1486ec803fbc07da2bd880289
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

fix: the site refuses an empty crash report

Assisted-by: claude-opus-5.5

2 files changed, 6 insertions(+), 0 deletions(-)

crates/relay/src/site.rs+3
......@@ -173,6 +173,9 @@ fn keep_crash(
173173 else {
174174 return "411 Length Required";
175175 };
176 if length == 0 {
177 return "400 Bad Request";
178 }
176179 if length > REPORT {
177180 return "413 Content Too Large";
178181 }
crates/relay/tests/site.rs+3
......@@ -170,6 +170,9 @@ fn crash_reports_are_kept_small_and_few_and_never_echoed() {
170170 b"POST /crash HTTP/1.1\r\nContent-Type: text/plain\r\nContent-Length: 2\r\n\r\n\xff\xfe",
171171 );
172172 assert!(invalid.starts_with("HTTP/1.1 400"), "{invalid}");
173 let empty =
174 site.send(b"POST /crash HTTP/1.1\r\nContent-Type: text/plain\r\nContent-Length: 0\r\n\r\n");
175 assert!(empty.starts_with("HTTP/1.1 400"), "{empty}");
173176
174177 // One sender is held to a few an hour; another, by the proxy's word, still gets in.
175178 let sent = (0..relay::site::PER_ADDRESS)