Glance server ignores Accept-Encoding

Bug #1150380 reported by Flavio Percoco on 2013-03-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Flavio Percoco

Bug Description

Glance server doesn't compress responses even thought the request correctly sends Accept-Encoding.

$ glance --debug image-list
curl -i -X GET -H 'X-Auth-Token: aca2aa0abfb347fe8b807034baa32ddb' -H 'Accept-Encoding: gzip, deflate, compress' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Content-Type: application/octet-stream'

HTTP/1.1 200 OK
date: Wed, 06 Mar 2013 20:47:44 GMT
content-length: 2267
content-type: application/json; charset=UTF-8
x-openstack-request-id: req-2091d29f-8afd-4bd7-86a4-e12829fdd6c0

Changed in glance:
assignee: nobody → Flavio Percoco Premoli (flaper87)

Fix proposed to branch: master

Changed in glance:
status: New → In Progress
Brian Waldon (bcwaldon) on 2013-03-06
Changed in glance:
importance: Undecided → Wishlist
Changed in glance:
milestone: none → havana-1

Fix proposed to branch: master

Submitter: Jenkins
Branch: master

commit 0a4f4aff6c0ef7b74492dab6a88a2f4e40a3a422
Author: Flaper Fesp <email address hidden>
Date: Sat Apr 27 14:42:15 2013 +0200

    Compress response's content according to client's accepted encoding

    Currently Glance ignores the Accept-Encoding header and returns
    responses as they are regardless the client accepts gzip or other type
    of compression.

    This patch adds this capability to glance (by using a middleware)
    supporting just gzip for now.

    Important note:
        - The patch uses a lazy compression for Content-Type
        application/octet-stream but in order to do that, the
        content-length has to be unset which means that when an image is
        downloaded the content-length will be unknown to the client.

    Fixes bug: 1150380

    Change-Id: Ieb65837d4e3fe310f97d9666882ecc572b14956a

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-05-29
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in glance:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers