OpenStack Image Registry and Delivery Service (Glance)

Root document contains incorrect href with 0.0.0.0

Reported by Pete Zaitcev on 2012-01-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Medium
Pete Zaitcev

Bug Description

If the default configuration is used, with bind_host=0.0.0.0, the root document looks like this:

{"versions": [{"status": "CURRENT", "id": "v1.1", "links": [{"href": "http://0.0.0.0:9292/v1/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v1.0", "links": [{"href": "http://0.0.0.0:9292/v1/", "rel": "self"}]}]}

These href values cannot be used by a remote client.

The correct way to reconstruct remote URLs require using the HTTP request header Host: for HTTP 1.1 clients, or the connect address for HTTP 1.0 clients. The bind address should not be used.

Note that using bind address is also incompatible with IPv6.

Please see proposed patch at
https://review.openstack.org/2988

Changed in glance:
assignee: nobody → Pete Zaitcev (zaitcev)
status: New → In Progress
Jay Pipes (jaypipes) on 2012-01-12
Changed in glance:
importance: Undecided → Medium
milestone: none → essex-3

Reviewed: https://review.openstack.org/2988
Committed: http://github.com/openstack/glance/commit/b46401a17b68dee4568e7ff01a5534a62eb9285f
Submitter: Jenkins
Branch: master

commit b46401a17b68dee4568e7ff01a5534a62eb9285f
Author: Pete Zaitcev <email address hidden>
Date: Wed Jan 11 21:24:22 2012 -0700

    Return correct href if bind_host is 0.0.0.0.

    The existing code returns incorrect href= in the root document (aka
    "version" document) if the default configuration is used. If a remote
    system accesses Glance API, the netspec of href= contains 0.0.0.0,
    which cannot be used for further remote accesses. This happens because
    attempts to use local configuration or the bind address to reconstruct
    URLs are futile.

    The correct way resolve this problem is to use the Host: header
    of the HTTP request. As a bonus, it works with IPv6, should we ever
    support it.

    Change-Id: I661351b679c695bd6ab310104a3246dd3069f9c6
    Bug: 915621

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-01-25
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in glance:
milestone: essex-3 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers