Glance returned 404 status code when we specify bad headers or we do not specify headers when updated artifact

Bug #1490979 reported by Darja Shakhray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
Unassigned

Bug Description

ENVIRONMENT: devstack, Glance (master, 31.08.2015)

STEPS TO REPRODUCE:
We are trying to upgrade artifact

1) curl -H "X-Auth-Token: 3b4e028c1e6f457595497afc1df37ffb" -H "ddd" POST -d '{"data":"la-la"}' http://172.18.76.44:9292/v3/artifacts/myartifact/v2.0/91671992-c84e-4723-9024-3c9b6dddf079/description -i

2)curl -H "X-Auth-Token: 3b4e028c1e6f457595497afc1df37ffb" POST -d '{"data":"la-la"}' http://172.18.76.44:9292/v3/artifacts/myartifact/v2.0/91671992-c84e-4723-9024-3c9b6dddf079/description -i

EXPECTED RESULT:
status code 400 and message error

ACTUAL RESULT:
curl: (6) Could not resolve host: POST
HTTP/1.1 404 Not Found
Content-Length: 154
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-40cae297-ccbe-4507-945f-e6ebfd29ab23
Date: Tue, 01 Sep 2015 13:08:38 GMT

<html>
 <head>
  <title>404 Not Found</title>
 </head>
 <body>
  <h1>404 Not Found</h1>
  The resource could not be found.<br /><br />

 </body>
</html>

Tags: artifacts
Revision history for this message
Niall Bunting (niall-bunting) wrote :

You need to add -X in front of POST as curl thinks that POST is the host name.

curl -H "X-Auth-Token: 3b4e028c1e6f457595497afc1df37ffb" -X POST -d '{"data":"la-la"}' http://172.18.76.44:9292/v3/artifacts/myartifact/v2.0/91671992-c84e-4723-9024-3c9b6dddf079/description -i

Changed in glance:
status: New → Invalid
Revision history for this message
Darja Shakhray (dshakhray) wrote :

Naill, you're right, I missed -X, but the result has not changed

curl -H "X-Auth-Token: c50d426620c848c5a0a15d498d25e6c1" -H "ddd" -X POST -d '{"data":"la-la"}' http://172.18.76.44:9292/v3/artifacts/myartifact/v2.0/91671992-c84e-4723-9024-3c9b6dddf079/description -i
HTTP/1.1 404 Not Found
Content-Length: 154
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-f3e8b3bf-4bcc-427b-ade9-d1b2bf5f70af
Date: Tue, 01 Sep 2015 14:59:24 GMT

<html>
 <head>
  <title>404 Not Found</title>
 </head>
 <body>
  <h1>404 Not Found</h1>
  The resource could not be found.<br /><br />

 </body>
</html

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.