API "links" may end up with the wrong host/port

Bug #2007170 reported by Michael Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Confirmed
Medium
Unassigned

Bug Description

When enabled_host_header is enabled there is the possibility that the "links" in API responses will get the wrong URL path back.

For example, in a devstack run, a link was rendered:
        "links": {
            "self": "http://127.0.0.1:60053/v2/zones/a3365b47-ee93-43ad-9a60-2b2ca96b1898/shares/4495ffbb-b7d1-43e0-9423-f0a4172e5f9e",

Where the port used is actually the uwsgi port and not the front end location as published in endpoints: http://10.21.21.126/dns

It seems like the api_base_uri is being ignored here and the "requests.host_url" may not be the right information to collect when running behind uwsgi.

This is the method used to generate the "link" host information. (_get_base_url)
https://github.com/openstack/designate/blob/master/designate/objects/adapters/api_v2/base.py#L77

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.