PUT with X-Copy-From header requires content length header

Bug #646039 reported by John Dickinson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Won't Fix
Low
Unassigned

Bug Description

PUT operations with an X-Copy-From header require a content length header, even though the final content-length is found from the source object (referenced in the X-Copy-From header).

Since there is no need to read a body from this form of PUT, there is no need to require a content-length.

Alternatively, it may be correct to simply require a content-length of 0 (current behavior).

Changed in swift:
importance: Undecided → Low
Revision history for this message
clayg (clay-gerrard) wrote :

I think this should be "won't fix"

PUT's require the content-length of the body (or chunked encoding, your choice). On a X-Copy-From the body of the request should be length zero (it's ignored anyway). I think the correct behavior is to require the user/agent to explicitly state the content-length of the request as zero.

If you don't want to specify content-length use COPY.

curl -XCOPY -H "Destination: big_files/copiedfile" -k -H "x-auth-token: xxx" https://xxx.clouddrive.com/v1/xxx/big_files/mytestfile.out
<html>
 <head>
  <title>201 Created</title>
 </head>
 <body>
  <h1>201 Created</h1>
  <br /><br />

If anything we *might* file a bug that swift should return a 412 on PUT requests with an X-Copy-From header in which the content-length is NON-zero, or a body is included. But that's probably also low importance. Simply ignoring these those values is unlikely to cause anyone grief.

Revision history for this message
John Dickinson (notmyname) wrote :

I agree. PUT requests should either have a content length header or use chunked transfer encoding. Returning an error on PUTs with an X-Copy-From header and a non-empty body should probably return an error to the user.

Changed in swift:
status: New → Won't Fix
Revision history for this message
John Dickinson (notmyname) wrote :

new bug created for returning an error to the user created at https://bugs.launchpad.net/swift/+bug/651162

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.