func tests must not assert accept-ranges on 304

Bug #1667833 reported by clayg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Confirmed
Low
Unassigned

Bug Description

Direct to swift request:

ubuntu@ubuntu-xenial:~$ curl -H 'x-auth-token: gAAAAABYsLZmr8f-P51zSu2SDUtMR59AnM3KNwZnJ4lrQ8H9CkH2oDle53hDdx_SMCyYMizfvYRVruTvaQ1ZYXOHWBuxXGTvJCit7suLLCsZ6fuLBhYFMmBQQlhOy-P3DluWZUkEm0eyzlckgQL-4Pec4gmhzS8IRd-iP1KPbliKzQl1gsAj1Rw' http://192.168.8.8:8081/v1/AUTH_26270426bec94d2dad4ff359d8af543a/test/test -H 'if-none-match: d41d8cd98f00b204e9800998ecf8427e' -v
* Trying 192.168.8.8...
* Connected to 192.168.8.8 (192.168.8.8) port 8081 (#0)
> GET /v1/AUTH_26270426bec94d2dad4ff359d8af543a/test/test HTTP/1.1
> Host: 192.168.8.8:8081
> User-Agent: curl/7.47.0
> Accept: */*
> x-auth-token: gAAAAABYsLZmr8f-P51zSu2SDUtMR59AnM3KNwZnJ4lrQ8H9CkH2oDle53hDdx_SMCyYMizfvYRVruTvaQ1ZYXOHWBuxXGTvJCit7suLLCsZ6fuLBhYFMmBQQlhOy-P3DluWZUkEm0eyzlckgQL-4Pec4gmhzS8IRd-iP1KPbliKzQl1gsAj1Rw
> if-none-match: d41d8cd98f00b204e9800998ecf8427e
>
< HTTP/1.1 304 Not Modified
< Content-Length: 0
< Content-Type: application/octet-stream
< Accept-Ranges: bytes
< Last-Modified: Fri, 24 Feb 2017 18:22:10 GMT
< Etag: d41d8cd98f00b204e9800998ecf8427e
< X-Timestamp: 1487960529.71427
< X-Object-Meta-Mtime: 1487960525.638411
< X-Trans-Id: tx12d4acd8de484568a4c0f-0058b0b696
< X-Openstack-Request-Id: tx12d4acd8de484568a4c0f-0058b0b696
< Date: Fri, 24 Feb 2017 22:41:26 GMT
<
* Connection #0 to host 192.168.8.8 left intact

Request behind Apache:

ubuntu@ubuntu-xenial:~$ curl -H 'x-auth-token: gAAAAABYsLZmr8f-P51zSu2SDUtMR59AnM3KNwZnJ4lrQ8H9CkH2oDle53hDdx_SMCyYMizfvYRVruTvaQ1ZYXOHWBuxXGTvJCit7suLLCsZ6fuLBhYFMmBQQlhOy-P3DluWZUkEm0eyzlckgQL-4Pec4gmhzS8IRd-iP1KPbliKzQl1gsAj1Rw' https://192.168.8.8:8080/v1/AUTH_26270426bec94d2dad4ff359d8af543a/test/test -H 'if-none-match: d41d8cd98f00b204e9800998ecf8427e' -v
* Trying 192.168.8.8...
* Connected to 192.168.8.8 (192.168.8.8) port 8080 (#0)
* found 176 certificates in /etc/ssl/certs/ca-certificates.crt
* found 704 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* server certificate verification OK
* server certificate status verification SKIPPED
* common name: localhost (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: O=OpenStack,OU=DevStack Servers,CN=localhost
* start date: Fri, 24 Feb 2017 15:43:39 GMT
* expire date: Sat, 24 Feb 2018 15:43:39 GMT
* issuer: O=OpenStack,OU=DevStack Certificate Authority,CN=Intermediate CA
* compression: NULL
* ALPN, server accepted to use http/1.1
> GET /v1/AUTH_26270426bec94d2dad4ff359d8af543a/test/test HTTP/1.1
> Host: 192.168.8.8:8080
> User-Agent: curl/7.47.0
> Accept: */*
> x-auth-token: gAAAAABYsLZmr8f-P51zSu2SDUtMR59AnM3KNwZnJ4lrQ8H9CkH2oDle53hDdx_SMCyYMizfvYRVruTvaQ1ZYXOHWBuxXGTvJCit7suLLCsZ6fuLBhYFMmBQQlhOy-P3DluWZUkEm0eyzlckgQL-4Pec4gmhzS8IRd-iP1KPbliKzQl1gsAj1Rw
> if-none-match: d41d8cd98f00b204e9800998ecf8427e
>
< HTTP/1.1 304 Not Modified
< Date: Fri, 24 Feb 2017 22:41:49 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Connection: close
< Etag: d41d8cd98f00b204e9800998ecf8427e
<
* Closing connection 0

You can not assert the < Accept-Ranges: bytes header in this response in a functional test.

Mostly added in https://review.openstack.org/#/c/293633/

Revision history for this message
Tim Burke (1-tim-z) wrote :

New RFC [1] definitely advises against it:

> Since the goal of a 304 response is to minimize information transfer
> when the recipient already has one or more cached representations, a
> sender SHOULD NOT generate representation metadata other than
> [Cache-Control, Content-Location, Date, ETag, Expires, and Vary]
> unless said metadata exists for the purpose of guiding cache updates
> (e.g., Last-Modified might be useful if the response does not have
> an ETag field).

Old RFC [2] even specified conditions where such headers MUST NOT be sent:

> If the conditional GET used a strong cache validator (see section
> 13.3.3), the response SHOULD NOT include other entity-headers.
> Otherwise (i.e., the conditional GET used a weak validator), the
> response MUST NOT include other entity-headers; this prevents
> inconsistencies between cached entity-bodies and updated headers.

Maybe we should ensure we *don't* send Accept-Ranges? Or, for that matter, Content-Type or X-Object-Meta-*. I'm rather annoyed with Apache for dropping the transaction ID though :-(

Note that there seem to be other circumstances in which Apache messes with our headers [3]...

[1] https://tools.ietf.org/html/rfc7232#section-4.1
[2] https://tools.ietf.org/html/rfc2616.html#section-10.3.5
[3] https://bugs.launchpad.net/python-swiftclient/+bug/1621581

Tim Burke (1-tim-z)
Changed in swift:
status: New → Confirmed
importance: Undecided → Low
tags: added: low-hanging-fruit
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.