summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index d0e771e22..925c6d42c 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -636,8 +636,11 @@ class Controller(wsgi.Controller):
# If the image href was generated by nova api, strip image_href
# down to an id and use the default glance connection params
- if str(image_href).startswith(req.application_url):
- image_href = image_href.split('/').pop()
+ image_href = image_href.split('/').pop()
+
+ if not utils.is_uuid_like(str(image_href)):
+ msg = _("Invalid imageRef provided.")
+ raise exc.HTTPBadRequest(explanation=msg)
personality = server_dict.get('personality')
config_drive = server_dict.get('config_drive')