Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PutObject incompatibility with RFC-7232 and difference to AWS #19442

Closed
steve-o opened this issue Apr 9, 2024 · 1 comment · Fixed by #19448
Closed

PutObject incompatibility with RFC-7232 and difference to AWS #19442

steve-o opened this issue Apr 9, 2024 · 1 comment · Fixed by #19448

Comments

@steve-o
Copy link

steve-o commented Apr 9, 2024

Per RFC-7232 §6: precedence a PUT request should return 412 not 304.

 3.  When If-None-Match is present, evaluate the If-None-Match
       precondition:

       *  if true, continue to step 5

       *  if false for GET/HEAD, respond 304 (Not Modified)

       *  if false for other methods, respond 412 (Precondition Failed)

However AWS S3 documentation does not explicitly note support for conditional requests for PutObject, only on GetObject (and some others like CopyObject).

GET /Key+?partNumber=PartNumber&response-cache-control=ResponseCacheControl&response-content-disposition=ResponseContentDisposition&response-content-encoding=ResponseContentEncoding&response-content-language=ResponseContentLanguage&response-content-type=ResponseContentType&response-expires=ResponseExpires&versionId=VersionId HTTP/1.1
Host: Bucket.s3.amazonaws.com
If-Match: IfMatch
If-Modified-Since: IfModifiedSince
If-None-Match: IfNoneMatch
If-Unmodified-Since: IfUnmodifiedSince

Apparently AWS returns a not implemented response: https://stackoverflow.com/questions/12654828/amazon-s3-avoid-overwriting-objects-with-the-same-name (?)

Expected Behavior

Minio should either copy AWS S3, or correctly follow RFC-7232. Either way differences should be noted in the documentation.

Current Behavior

⚠️ Running behind Cloudflare tunnels
Minio returns 304:

PUT https://...
if-none-match: "afa3a23620d1c15e7081a5bdf6cd5f94"

HTTP 304 Not Modified

Steps to Reproduce (for bugs)

  1. Upload a file
  2. Re-upload the same file with a if-none-match header with matching ETag.

Context

Trying to prevent duplicate uploads of the same content.

Your Environment

  • Version used (minio --version): RELEASE.2023-11-20T22-40-07Z
  • Server setup and configuration: Docker
@harshavardhana
Copy link
Member

We don't intend to change here and comply with AWS S3.

These headers are necessary for optimistic concurrency.

Will add the 412 instead of 304.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants