def _inject_location_header(self, response, image_meta):
+ if 'location' in image_meta:
+ del image_meta['location']
+ if 'x-image-meta-location' in response.headers:
+ del response.headers['x-image-meta-location']
location = self._get_image_location(image_meta) response.headers['Location'] = location.encode('utf-8')
Or to additionally handle the case where the response header's x-image- meta-location filed
has been populated:
$ git diff glance/ api/v1/ images. py api/v1/ images. py b/glance/ api/v1/ images. py api/v1/ images. py api/v1/ images. py (wsgi.JSONRespo nseSerializer) :
self. notifier = notifier.Notifier()
diff --git a/glance/
index 7068820..3e8741c 100644
--- a/glance/
+++ b/glance/
@@ -947,6 +947,10 @@ class ImageSerializer
def _inject_ location_ header( self, response, image_meta): 'location' ] meta-location' in response.headers: headers[ 'x-image- meta-location' ] image_location( image_meta)
response. headers[ 'Location' ] = location. encode( 'utf-8' )
+ if 'location' in image_meta:
+ del image_meta[
+ if 'x-image-
+ del response.
location = self._get_