Accept header bug with listings

Bug #1202453 reported by gholt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Samuel Merritt

Bug Description

Normally I'd just patch this up and submit a review, but it's been a rough few weeks so I'll just post this small issue we noticed:

$ curl -i http://127.0.0.1:8080/v1/AUTH_test -H 'X-Auth-Token:AUTH_tk7fb1e7a3caea48138f49c6643294a5ca' -H "Accept: text/xml"
HTTP/1.1 200 OK
Content-Length: 154
Accept-Ranges: bytes
X-Timestamp: 1374110708.32134
X-Account-Bytes-Used: 0
X-Account-Container-Count: 1
Content-Type: text/xml; charset=utf-8
X-Account-Object-Count: 0
Date: Thu, 18 Jul 2013 01:26:28 GMT

<?xml version="1.0" encoding="UTF-8"?>
<account name="AUTH_test">
<container><name>container</name><count>0</count><bytes>0</bytes></container>
</account>

$ curl -i http://127.0.0.1:8080/v1/AUTH_test -H 'X-Auth-Token:AUTH_tk7fb1e7a3caea48138f49c6643294a5ca' -H "Accept: text/xml;charset=UTF-8"
HTTP/1.1 406 Not Acceptable
Content-Length: 112
Content-Type: text/html; charset=UTF-8
Date: Thu, 18 Jul 2013 01:27:15 GMT

<html><h1>Not Acceptable</h1><p>The resource is not available in a format acceptable to your browser.</p></html>

Revision history for this message
gholt (gholt) wrote :

Looks to be a bug in swob:

$ python -c 'from swift.common import swob; print swob.Accept("text/xml;charset=UTF-8")._get_types()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/gholt/swift/swift/common/swob.py", line 620, in _get_types
    raise ValueError('Invalid accept header')
ValueError: Invalid accept header

Changed in swift:
assignee: nobody → Samuel Merritt (torgomatic)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/37812

Changed in swift:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/37812
Committed: http://github.com/openstack/swift/commit/91e7e876b54c44e81df9fa10b111fb57d6c92107
Submitter: Jenkins
Branch: master

commit 91e7e876b54c44e81df9fa10b111fb57d6c92107
Author: Samuel Merritt <email address hidden>
Date: Thu Jul 18 16:33:01 2013 -0700

    Accept valid Accept headers in swob.

    "Accept: application/xml; charset=UTF-8" is totally valid, and has an
    implicit q (quality) value of 1.0, just the same as "Accept: text/xml"
    does.

    Also, you can say things like:
    Accept: text/xml; charset=UTF-8; q=0.9; anglebrackets="are awesome"
    with as many arbitrary extensions as you want.

    See RFC 2616 sections 14.1 Accept and 2.2 Basic Rules for details.

    Fixes bug 1202453.

    Change-Id: I18e6d0ee3fd6f9d889275ee8335e711c729b7171

Changed in swift:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/ec)

Fix proposed to branch: feature/ec
Review: https://review.openstack.org/38552

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (feature/ec)
Download full text (15.3 KiB)

Reviewed: https://review.openstack.org/38552
Committed: http://github.com/openstack/swift/commit/f3ba55039c4caa91b71b453f2dc1f5310c2ac801
Submitter: Jenkins
Branch: feature/ec

commit f2c3e1af9cf0ad1fbf7753cd2e5caef9bd297cb5
Author: Samuel Merritt <email address hidden>
Date: Mon Jul 22 16:14:59 2013 -0700

    Fix bulk's unit tests on Mac OS.

    Turns out if your $TMPDIR is really long
    (e.g. /var/folders/vq/n32yszdn4s76z6l8dxklmwdh0000gn/T/, which is 50
    characters), then the test that drops stuff into $TMPDIR and adds it
    to a tarball and uploads it will fail due to every added file's name
    being too long.

    Change-Id: I8fcab2d95091f72b831b906bfc87a36d8be12631

commit 5c1a7871d9173db9fbd855b72a98ecd8ff163800
Author: Newptone <email address hidden>
Date: Sun Jul 21 12:18:24 2013 +0800

    Unified format of boolean params in conf files

    In swift conf files, boolean options use different
    format: some use true/false, and some use True/False.
    This patch is aim to using lowcase true/false to unify
    boolean params formats in swift conf files.

    Fix Bug #1203421

    Change-Id: I3e1bfc6e43231f51e0710aa54869f3774ee896b1

commit 63061e37ed098bf1ad509177484037544eb6b089
Author: Kun Huang <email address hidden>
Date: Tue Jul 23 13:46:51 2013 +0800

    Add notes for /srv/node in swift-object-info

    'devices' is set in object-server.conf on each node, not in ring data,
    and the things printed here is just for watching not for running, so
    just leave a note here. (this https://review.openstack.org/#/c/23951/
    is used for running, so just a note is not enough)

    mark this commit as bug fixing is because this script is the last place
    using /srv/node but not from conf as Chmouel said.

    fixes import change on read_metadata
    fixes bug #885006
    Change-Id: I727ec2d01c093af61fd3895e5701d87ef67cd9ff

commit 13bbe4b7c31b17efbebd91bd01586757600a082b
Author: Michael Barton <email address hidden>
Date: Mon Jul 22 21:12:22 2013 -0700

    fix unit tests in 2.6 by using closing(GzipFile)

    Python 2.6 doesn't support using GzipFile as a context manager.

    Change-Id: Ic12b5a916bc89ae8d4480879723201c1715285af

commit 6384b192b55b823d86078588f22b8bc847954aad
Author: Alex Gaynor <email address hidden>
Date: Mon Jul 22 14:59:30 2013 -0700

    Ensure that files are always closed explicitly.

    This is needed on Pythons without reference
    counting garbage collectors (e.g. PyPy).

    Change-Id: Ieb563ace9f65a4ad204b01be32bf7a9d5f226005

commit 0e3103c0dd3690f5e69ec7953c270430d0564d12
Author: Alex Gaynor <email address hidden>
Date: Mon Jul 22 15:27:54 2013 -0700

    Corrected a number of style violations in the tests.

    Change-Id: Ib5e81ad0476c56cf84d222d67f55b8db3eb0249e

commit fc293a750c8a83ec99d3b462b4689741c1e66a9b
Author: Peter Portante <email address hidden>
Date: Wed Jul 17 17:41:41 2013 -0400

    Move the mount checking into DiskFile constructor

    Move the mount checking into the DiskFile object constructor. The
    REPLICATE method does not use the DiskFile object currently, so that
    method st...

Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.9.1
status: Fix Committed → Fix Released
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.