PUT with X-Copy-From header requires content length header
Bug #646039 reported by
John Dickinson
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 |
To post a comment you must log in.
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/mytestfil e.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.