Swift Accept Header does not comply with RFC rules on quality values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Swift is not complying with the RFC rules below on quality values. Using the Accept Header support, Swift is able to generate more than 3 digits after the decimal point instead of producing a status code of 406 - NOT_ACCEPTABLE. Example below after the description:
3.9 Quality Values
HTTP content negotiation (section 12) uses short "floating point"
numbers to indicate the relative importance ("weight") of various
negotiable parameters. A weight is normalized to a real number in
the range 0 through 1, where 0 is the minimum and 1 the maximum
value. If a parameter has a quality value of 0, then content with
this parameter is `not acceptable' for the client. HTTP/1.1
applications MUST NOT generate more than three digits after the
decimal point. User configuration of these values SHOULD also be
limited in this fashion.
curl -X GET -i -H "X-Auth-Token: $token" http://
HTTP/1.1 200 OK
Content-Length: 867
X-Container-
Accept-Ranges: bytes
X-Storage-Policy: gold
X-Container-
X-Timestamp: 1457655301.60066
Content-Type: text/xml; charset=utf-8
X-Trans-Id: txf92b4adc15774
Date: Tue, 29 Mar 2016 14:48:27 GMT
<?xml version="1.0" encoding="UTF-8"?>
<container name="Tont"
I don't think this is a valid bug. Swift does not generate more than 3 digits after the decimal point; in the example above Swift _consumes_ a header with more than 3 digits. The error is on the client side in this case. I can't find a reference in the RFC (https:/ /www.w3. org/Protocols/ rfc2616/ rfc2616- sec3.html) that an application should return a 406 in this case.