* volume: check a CRC32C of each chunk upload, in every digest mode
In sha256 digest mode the uploader sends no Content-MD5, so the volume
server and its replicas store a chunk without checking that its bytes
arrived as sent. The uploader now sends X-Seaweed-Content-Crc32c, the
std-base64 of the big-endian CRC32C of the bytes Content-MD5 is checked
against (the file data after undoing Content-Encoding: gzip; the
ciphertext for ciphered chunks), in both digest modes. Uploads that
forward a stored needle (IsReplication) carry only a value the primary
volume server checked.
The Go and Rust volume servers refuse a mismatch or a malformed value
with 400, as they refuse a wrong Content-MD5, and forward the checked
value to replicas, which check it again. A gzipped upload without
Content-MD5 is checksummed while its size is counted, without holding
the uncompressed bytes. Servers that predate the header ignore it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): keep the first part's headers when no part has a filename
Go's parseUpload falls back to the first multipart part with its
Content-Type, Content-MD5 and Content-Encoding. The Rust fallback dropped
them, so a gzipped part without a filename was stored as plain bytes and
its X-Seaweed-Content-Crc32c was checked against the compressed body.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): read the RFC 2231 filename* of a multipart part
Go's uploader names a part with mime.FormatMediaType, which writes
filename*=utf-8''... for a non-ASCII name, and Go's Part.FileName()
decodes it. multer reads only filename, so the Rust volume server missed
the file part and lost its name, gzip encoding and Content-MD5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume: send replicas the CRC32C of a rewritten JPEG
Once the orientation fix rewrites a JPEG, the client's CRC32C no longer
covers the bytes the primary forwards, so the replica got no checksum.
Send the CRC32C of the stored bytes instead, in Go and Rust.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): read filename* only outside quoted parameter values
A quoted name such as "note; filename*=utf-8''decoy" split at its
semicolon and was taken for the part's filename.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): refuse a decoded filename* with control characters
A percent-encoded CR/LF in the name would end the header block of the
part the primary forwards to its replicas.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume: read the forwarded CRC32C with the replica response in the test
A failing assertion left the CRC32C in the one-slot channel, so the next
subtest's replica blocked instead of the test reporting the failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* volume(rs): use naïve for the non-ASCII filename test data
codespell reads the ASCII part of café as a misspelling of calf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>