Patches bytes-read-whole and key-log-uncapped; bytes-unchecked, fetch-budget-unchecked and fetch-unmemoised regenerated against the new fetcher. Co-Authored-By: Claude Opus 5.5 <[email protected]>
22 lines
1.1 KiB
Diff
22 lines
1.1 KiB
Diff
# must fail: receipts_fetch_bytes_exhausted
|
|
# each receipt file read to its cap plus one byte whatever remains of the index's bytes, the budget counted after (receipts::ReceiptFetcher::get)
|
|
diff --git a/wai/wai-rs/src/http_binding/receipts.rs b/wai/wai-rs/src/http_binding/receipts.rs
|
|
index bdec9436..9d68b900 100644
|
|
--- a/wai/wai-rs/src/http_binding/receipts.rs
|
|
+++ b/wai/wai-rs/src/http_binding/receipts.rs
|
|
@@ -300,13 +300,13 @@ impl<'f> ReceiptFetcher<'f> {
|
|
return Err(ReceiptRefusal::BytesExhausted);
|
|
}
|
|
self.fetched += 1;
|
|
- let limit = remaining.min(MAX_RECEIPT_FILE_BYTES + 1);
|
|
+ let limit = MAX_RECEIPT_FILE_BYTES + 1;
|
|
let served = match (self.fetch)(h, limit) {
|
|
None => Served::Nothing,
|
|
Some(mut b) => {
|
|
b.truncate(limit);
|
|
self.bytes += b.len();
|
|
- if b.len() == remaining { Served::PastBytes } else { Served::Bytes(b) }
|
|
+ if b.len() > remaining { Served::PastBytes } else { Served::Bytes(b) }
|
|
}
|
|
};
|
|
self.memo.insert(*h, served);
|