tempurl Content-Disposition header missing from HEAD

Bug #1539805 reported by clayg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Wishlist
David Liu

Bug Description

tempurl adds a Content-Disposition header for you to notate that an object should be downloaded instead of displayed inline

I'm guessing this is *not* what you want most of the time (since it mainly only matters in browsers, and browsers are better than we are at doing the right thing based on the content-type) - but nevertheless - it's always been this way [1]

The really *bad* part of this behavior is that we only do it to GETs. If you make a HEAD request (say via -I with curl) you have *no idea* that the headers are different between a tempurl request and a x-auth-token request.

I'm pretty sure HTTP says you're not supposed do different things for HEAD than you would do with GET wrt to the headers and status etc [2]

I think we just need to change the explicit check of `method == 'GET'` to a `method in ('GET', 'HEAD')` and then write a unittest and ship it! [3]

1. 7fc1721d was hard to find because of the great extract all the middleware fiasco of '12
2. https://tools.ietf.org/html/rfc2616#section-9.4
3. https://github.com/openstack/swift/blob/a507d686d29825832f1760db6ab909ba6eb778d5/swift/common/middleware/tempurl.py#L402

clayg (clay-gerrard)
description: updated
clayg (clay-gerrard)
description: updated
David Liu (lzbj)
Changed in swift:
assignee: nobody → David Liu (lzbj)
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/296936

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/296936
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=3407d737c705a7afedeed0159588ab4433a601f3
Submitter: Jenkins
Branch: master

commit 3407d737c705a7afedeed0159588ab4433a601f3
Author: David Liu <email address hidden>
Date: Thu Mar 24 16:08:19 2016 +0800

    Handle tempurl Content-Disposition header missing from HEAD

    Content-Disposition headers should make no difference between
    GET and HEAD according to HTTP rfc.

    Closes-Bug: #1539805

    Change-Id: Ifa41a7cda2f321eb8e36420ede7912ed0a549712

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

Fix proposed to branch: feature/crypto
Review: https://review.openstack.org/299944

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

Reviewed: https://review.openstack.org/299944
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=77c181161a029ba8cea5d1ce65f979fe4b23ff37
Submitter: Jenkins
Branch: feature/crypto

commit 59bbe27fb0a40236108f09c9b3349e8faef0a95c
Author: Nguyen Hung Phuong <email address hidden>
Date: Wed Mar 30 11:07:46 2016 +0700

    Fix typos in Swift files

    Change-Id: I34e0c9a888127704ac1910e73ddd14e27ebade13

commit 7be55acf1bc4aa07d81b30fd93e144700889898d
Author: Tim Burke <email address hidden>
Date: Thu Feb 11 16:00:38 2016 -0800

    Simplify policy-name validation slightly

    _validate_policy_name always either returns True or raises an exception.
    Simplify it to just being a callable that may raise an exception.

    Also, move the check for blank/None names into _validate_policy_name, so
    it will be applied in more cases.

    Change-Id: I7832a0c9c895cd75ba4c6d0e8b5568a3c8a0ea25

commit 5902015fa8495ec0ef3c1ab92ae9a34c5bda4334
Author: OpenStack Proposal Bot <email address hidden>
Date: Sat Mar 26 06:35:18 2016 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I3b5d401649fa3dea6dc43654516f7075bb06ee0d

commit 2f7d0f4a2ad2da7e6a35e5b054a47a2fafe5ed01
Author: Anh Tran <email address hidden>
Date: Fri Mar 25 11:44:26 2016 +0700

    Removing some redundant words

    This patch removes some redundant words.

    Change-Id: Ia79717664b06ed9a41c3c5dcf1a25e9e49e21cf2

commit 925546ae8a211b50cf7fad6634d47fd1dbfeb58e
Author: OpenStack Proposal Bot <email address hidden>
Date: Fri Mar 25 06:36:40 2016 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I6ba2f35913e6ae83607b5e268645432d455d587c

commit 3407d737c705a7afedeed0159588ab4433a601f3
Author: David Liu <email address hidden>
Date: Thu Mar 24 16:08:19 2016 +0800

    Handle tempurl Content-Disposition header missing from HEAD

    Content-Disposition headers should make no difference between
    GET and HEAD according to HTTP rfc.

    Closes-Bug: #1539805

    Change-Id: Ifa41a7cda2f321eb8e36420ede7912ed0a549712

commit 2f24fb9683a57b67348d65864d5af8c3a03dee67
Author: Alistair Coles <email address hidden>
Date: Wed Mar 23 20:49:50 2016 +0000

    Check marker params in SimpleClient full listing requests

    Follow up for change [1] to add some assertions to check that
    marker param is included in sequential GET requests sent during
    a full listing.

    Extract multiple FakeConn class definitions to single class at
    module level and share between all classes.

    Also, explicitly unpack the return values from base request calls
    made in the full listing section of base_request, and explicitly
    return a list to make more consistent with rest of the method.

    [1] Change-Id: I6892390d72f70f1bc519b482d4f72603e1570163

    Change-Id: Iad038709f46364b8324d25ac79be4317add79df...

tags: added: in-feature-crypto
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/hummingbird)

Fix proposed to branch: feature/hummingbird
Review: https://review.openstack.org/323599

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

Reviewed: https://review.openstack.org/323599
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=0330478b70d0a699a0f9c21ef87c7e639d92564b
Submitter: Jenkins
Branch: feature/hummingbird

commit 5fe392b562de3baed080704df433fb392cb4fb31
Author: Ondřej Nový <email address hidden>
Date: Tue May 31 16:25:50 2016 +0200

    Fixed typo

    Change-Id: I7a35c0076360c7a23cf405189828d3c252ec6708

commit b52eccb3b1ea0591f0040587228d3705b5d3f68d
Author: Clay Gerrard <email address hidden>
Date: Wed May 25 11:21:25 2016 -0700

    Clarify overload best practices in admin guide

    Change-Id: Ib7c08bdeab6374771bb8e2b05053e7e16973524d

commit f1fd50723bb84c4941e949895576733f6eb67793
Author: Christian Schwede <email address hidden>
Date: Wed May 25 09:53:31 2016 +0200

    Add dispersion --verbose example to admin guide

    Change-Id: I5f9cacedde2a329332ccf744800b6f2453e8b28e

commit b3ab715c055283ccfea9a504d6da20741d82e7ad
Author: Matthew Oliver <email address hidden>
Date: Wed May 25 14:35:54 2016 +1000

    Add ring-builder dispersion command to admin guide

    This change updates the admin guide to point out the dispersion command
    in swift-ring-builder and mentions the dispersion verbose table to make
    it more obvious to operators.

    Change-Id: I72b4c8b2d718e6063de0fdabbaf4f2b73694e0a4

commit fb7a8e9ab7596a36a6992a3a8f8c6d005a2c2829
Author: Tim Burke <email address hidden>
Date: Tue May 24 13:37:58 2016 -0700

    Add links to mitaka install guides

    Change-Id: I62331923751c521daded4468b5cc5f03655226bc

commit e09c4ee7800e82aa09ca2f6ae375420b766182a4
Author: Tim Burke <email address hidden>
Date: Fri Apr 29 12:12:00 2016 -0500

    Allow concurrent bulk deletes

    Before, server-side deletes of static large objects could take a long
    time to complete since the proxy would wait for a response to each
    segment DELETE before starting the next DELETE request.

    Now, operators can configure a concurrency factor for the slo and bulk
    middlewares to allow up to N concurrent DELETE requests. By default, two
    DELETE requests will be allowed at a time.

    Note that objects and containers are now deleted in separate passes, to
    reduce the likelihood of 409 Conflict responses when deleting
    containers.

    Upgrade Consideration
    =====================
    If operators have enabled the bulk or slo middlewares and would like to
    preserve the prior (single-threaded) DELETE behavior, they must add the
    following line to their [filter:slo] and [filter:bulk] proxy config
    sections:

       delete_concurrency = 1

    This may be done prior to upgrading Swift.

    UpgradeImpact
    Closes-Bug: 1524454
    Change-Id: I128374d74a4cef7a479b221fd15eec785cc4694a

commit 226557afc42c245e050d84162497f46341407ef7
Author: Tim Burke <email address hidden>
Date: Thu May 19 18:55:40 2016 -0700

    Turn on H703, so our translators don't punch us

    Change-Id: I4ce3068f79563e4d4296c6e1078bc12f0cf84c96
    Related-Bug: 1559431

commit 7b706926a8ed5bbcec3a678e868e301c9a6ed8f1
Author: Alistair Coles <email address hidden>
Date: Mon May ...

tags: added: in-feature-hummingbird
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/293907
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=6f78646ea2200fa2c5dd424589a6cae537f00deb
Submitter: Jenkins
Branch: master

commit 6f78646ea2200fa2c5dd424589a6cae537f00deb
Author: Sivasathurappan Radhakrishnan <email address hidden>
Date: Thu Mar 17 09:40:23 2016 +0000

    Add content-disposition header to tempurl request

    Added content-disposition header to HEAD tempurl request.
    As per HTTP docs[1] HEAD response must be identical to GET
    except return message-body response.

    [1]https://tools.ietf.org/html/rfc2616#section-9.4

    Change-Id: Ie60a6fb632613055da5279db5b128ce5ee5172ae
    Closes-Bug:#1539805

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/crypto)

Fix proposed to branch: feature/crypto
Review: https://review.openstack.org/325957

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

Reviewed: https://review.openstack.org/325957
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=ce0e16bcc56a3123490db9ca2978633815aa51c6
Submitter: Jenkins
Branch: feature/crypto

commit e9c9e1870b32ce948e758c01f1cfcf840a720c2c
Author: OpenStack Proposal Bot <email address hidden>
Date: Fri Jun 3 06:49:09 2016 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I0e061ecba6dc215d0d3b12aac14b8d4b08fbc682

commit 886fa0822a7881806fd5b2ac8aa66e0a628da3a8
Author: Thiago da Silva <email address hidden>
Date: Thu Jun 2 23:02:55 2016 -0400

    update pyeclib and liberasurecode links

    Change-Id: Ic6d04083618362778363fea1570caaa865e44557
    Signed-off-by: Thiago da Silva <email address hidden>

commit 6f78646ea2200fa2c5dd424589a6cae537f00deb
Author: Sivasathurappan Radhakrishnan <email address hidden>
Date: Thu Mar 17 09:40:23 2016 +0000

    Add content-disposition header to tempurl request

    Added content-disposition header to HEAD tempurl request.
    As per HTTP docs[1] HEAD response must be identical to GET
    except return message-body response.

    [1]https://tools.ietf.org/html/rfc2616#section-9.4

    Change-Id: Ie60a6fb632613055da5279db5b128ce5ee5172ae
    Closes-Bug:#1539805

commit 6b0e9a3e2464406743e01a3dd789d30c2bf81a2a
Author: Tim Burke <email address hidden>
Date: Thu Jun 2 16:49:32 2016 +0000

    Remove unused (but defaulted) args

    Every time we call start_server, check is True.
    Every time we call check_server, we use the default timeout.

    Change-Id: Id38182f15bcbfbb145b57cee179a8fd47ec8e2b7

commit e56a1a550aace984c8ec4b422fc884ddc579d2d0
Author: Kota Tsuyuzaki <email address hidden>
Date: Wed Jun 1 23:53:35 2016 -0700

    pids in probe is no longer used

    Change-Id: I1fd76004257a8c05ce8bb1f3ca0e45000509f833

commit 99186aded9d4904f63444eb8d33ab2d1c08eed76
Author: OpenStack Proposal Bot <email address hidden>
Date: Thu Jun 2 06:41:44 2016 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: Iaf727e51ab444e8cb6199fda45595fc69497ea2d

commit daae74ca65d945d53c53718b8875322ffe9f9ac4
Author: Nelson Almeida <email address hidden>
Date: Wed Jun 1 17:29:10 2016 -0300

    Adding sorting_method to admin_guide

    Change-Id: I1162f154e3a577a95f9f5ea0e0f723b7df5a4baf

commit 4f053c61d6ea49cf566fd7d3d3b1000f2a7a62b5
Author: Félix Cantournet <email address hidden>
Date: Wed Apr 27 22:17:01 2016 +0200

    Fix swift-dispersion in multi-region setups

    If you have 2 swift regions served by the same keystone,
    then the client cannot get the correct URL for the swift endpoint
    without specifying a region_name.

    Closes-Bug: 1587088
    Change-Id: Iaab883386e125c3ca6b9554389e63df17267a135

commit c1b1a5a0ee18776f035bee59e2faff58ec827b14
Author: Alistair Coles <email address hidden>
Date: Tue May 17 14:22:0...

Read more...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/hummingbird)

Fix proposed to branch: feature/hummingbird
Review: https://review.openstack.org/326772

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

Reviewed: https://review.openstack.org/326772
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=5ed46fee468f9211cd1111cb3eec795378ef7b9c
Submitter: Jenkins
Branch: feature/hummingbird

commit 88dbbe88bb8bc773171ebe1c94bfb821ca740e34
Author: John Dickinson <email address hidden>
Date: Wed Jun 1 15:46:32 2016 -0700

    AUTHORS/CHANGELOG updates for 2.8.0 release

    Change-Id: I0dba970b2970139bd9847d1abf74eed1a8a4996c

commit e9c9e1870b32ce948e758c01f1cfcf840a720c2c
Author: OpenStack Proposal Bot <email address hidden>
Date: Fri Jun 3 06:49:09 2016 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I0e061ecba6dc215d0d3b12aac14b8d4b08fbc682

commit 886fa0822a7881806fd5b2ac8aa66e0a628da3a8
Author: Thiago da Silva <email address hidden>
Date: Thu Jun 2 23:02:55 2016 -0400

    update pyeclib and liberasurecode links

    Change-Id: Ic6d04083618362778363fea1570caaa865e44557
    Signed-off-by: Thiago da Silva <email address hidden>

commit 6f78646ea2200fa2c5dd424589a6cae537f00deb
Author: Sivasathurappan Radhakrishnan <email address hidden>
Date: Thu Mar 17 09:40:23 2016 +0000

    Add content-disposition header to tempurl request

    Added content-disposition header to HEAD tempurl request.
    As per HTTP docs[1] HEAD response must be identical to GET
    except return message-body response.

    [1]https://tools.ietf.org/html/rfc2616#section-9.4

    Change-Id: Ie60a6fb632613055da5279db5b128ce5ee5172ae
    Closes-Bug:#1539805

commit 6b0e9a3e2464406743e01a3dd789d30c2bf81a2a
Author: Tim Burke <email address hidden>
Date: Thu Jun 2 16:49:32 2016 +0000

    Remove unused (but defaulted) args

    Every time we call start_server, check is True.
    Every time we call check_server, we use the default timeout.

    Change-Id: Id38182f15bcbfbb145b57cee179a8fd47ec8e2b7

commit e56a1a550aace984c8ec4b422fc884ddc579d2d0
Author: Kota Tsuyuzaki <email address hidden>
Date: Wed Jun 1 23:53:35 2016 -0700

    pids in probe is no longer used

    Change-Id: I1fd76004257a8c05ce8bb1f3ca0e45000509f833

commit 99186aded9d4904f63444eb8d33ab2d1c08eed76
Author: OpenStack Proposal Bot <email address hidden>
Date: Thu Jun 2 06:41:44 2016 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: Iaf727e51ab444e8cb6199fda45595fc69497ea2d

commit daae74ca65d945d53c53718b8875322ffe9f9ac4
Author: Nelson Almeida <email address hidden>
Date: Wed Jun 1 17:29:10 2016 -0300

    Adding sorting_method to admin_guide

    Change-Id: I1162f154e3a577a95f9f5ea0e0f723b7df5a4baf

commit 4f053c61d6ea49cf566fd7d3d3b1000f2a7a62b5
Author: Félix Cantournet <email address hidden>
Date: Wed Apr 27 22:17:01 2016 +0200

    Fix swift-dispersion in multi-region setups

    If you have 2 swift regions served by the same keystone,
    then the client cannot get the correct URL for the swift endpoint
    witho...

Read more...

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/swift 2.8.0

This issue was fixed in the openstack/swift 2.8.0 release.

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.