SWIFT operation COPY fails when content-length header contains extra spaces
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Swift Version Used:
================
Swift 1.4.3 Diablo
Problem
=======
While performing COPY operation of objects from one container to another, if we add additional spaces in the header content-length, the header does not get recognized and gives the following error. Please note that removing the spaces solves the problem
With Spaces in Content-Length header:
=======
curl --insecure -X PUT -D - -H "X-Auth-Token: <AUTHTOKEN>" -H "X-Copy-From : CONTAINER1/FILE1" -H "Content-Length : 0" <SWIFT-
HTTP/1.1 411 Length Required
Content-Length: 165
Content-Type: text/html; charset=UTF-8
X-Trans-Id: <TRANS ID>
Date: Mon, 14 Nov 2011 07:49:55 GMT
<html>
<head>
<title>411 Length Required</title>
</head>
<body>
<h1>411 Length Required</h1>
Content-Length header required.<br /><br />
</body>
</html>
Without Spaces in Content-Length header:
=======
curl --insecure -X PUT -D - -H "X-Auth-Token: <AUTHTOKEN>" -H "X-Copy-From : CONTAINER1/FILE1" -H "Content-Length:0" <SWIFT-
HTTP/1.1 201 Created
Content-Length: 118
Content-Type: text/html; charset=UTF-8
Etag: <etag>
Last-Modified: Mon, 14 Nov 2011 08:05:28 GMT
X-Trans-Id: <TRANSID>
Date: Mon, 14 Nov 2011 08:05:28 GMT
<html>
<head>
<title>201 Created</title>
</head>
<body>
<h1>201 Created</h1>
<br /><br />
</body>
</html>r
summary: |
- COPY command fails when content-length header contains extra spaces + SWIFT operation COPY fails when content-length header contains extra + spaces |
Changed in swift: | |
status: | New → Invalid |
This applies to any request header (x-auth-token, etc) -- a space in the field-name will cause the header to be unrecognised.
From http:// tools.ietf. org/html/ rfc2616:
and
field-name = token
and
token = 1*<any CHAR except CTLs or separators>
Hence, the header field name should not have any spaces in it.
This should be closed as invalid of won't fix.