Files
OpenList/server/s3/preconditions.go
T
jyxjjj 23164ac7f2 fix(s3): enforce conditional writes with valid object ETags
- Pin gofakes3 with conditional PUT, multipart completion, and copy support
- Derive object ETags from content and preserve matching multipart validators
- Keep conditional requests in the S3 handler instead of redirecting them
- Format modification times in UTC and propagate storage errors
- Close content readers and discard metadata after successful deletion
- Add regression tests for object hashes, metadata, and conditional redirects

Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
Signed-off-by: jyxjjj <16695261+jyxjjj@users.noreply.github.com>
2026-09-10 23:32:20 +08:00

13 lines
268 B
Go

package s3
import "net/http"
func hasPreconditions(r *http.Request) bool {
for _, name := range []string{"If-Match", "If-None-Match", "If-Modified-Since", "If-Unmodified-Since", "If-Range"} {
if _, ok := r.Header[name]; ok {
return true
}
}
return false
}