x-storage-url from remote server not referring to correct host address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Wishlist
|
gholt |
Bug Description
When I execute the following command from remote server:
curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://
I'd expect X-Storage-Url: http://
Instead it's pointing to 127.0.0.1. This is breaking the functionality of swift command line tool.
The current logic for X-Storage-Url is retrieving bind-ip from configuration and defaults to 127.0.0.1. I don't want to change bind address because typically there will be multiple IP addresses assigned to given server and we want the server to listen on all interfaces. So bindip shouldn't be used for constructing the Storage-Url header instead it should be constructed with current request's host name.
In common/
At line 435 modify like this:
storageurl = req.host_url + '/v1/' + self.reseller_
return Response(
This will calculate the x-storage-url dynamically based on the request url. This will resolve the issue of swift command client from remote host.
description: | updated |
Changed in swift: | |
status: | New → Confirmed |
Changed in swift: | |
importance: | Undecided → Wishlist |
Changed in swift: | |
milestone: | none → 1.7.6 |
status: | Fix Committed → Fix Released |
In /etc/swift/ proxy-server. conf, if you set the bind_ip to 192.168.10, things will work like you expect.
The code that determines the storage url is in the __init__() method of TempAuth.
It looks ok to me.
Take a look at it.
If it's not ok, why not?