yougov / velociraptor

BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

bad request when making #221

Open 0atman opened 6 years ago

0atman commented 6 years ago
curl 'https://deploy[redacted]/api/v1/profile/' -X PUT -H 'Cookie: sessionid="[id]"; csrftoken=[token]' -H 'Origin: https://deploy[redacted]' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-GB,en;q=0.9' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: https://deploy[redacted]' -H 'X-CSRFToken: [token]' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'DNT: 1' --data-binary '{"default_dashboard":"/api/v1/dashboard/5/"}' --compressed

Getting a bad request when trying to set a dashboard as default:

screenshot-deploy yougov net-2018 03 07-10-17-29

I am a new user, so perhaps it's that?

0atman commented 6 years ago

@lbolla

lbolla commented 6 years ago

It works for me (not a new user), so it may be caused by some missing permissions for newly created users.

jaraco commented 6 years ago

I also get a 204 for a similar request.

Bad Request suggests to me it's not an auth issue.

The 'resource' that handles that request is defined here. Looking at that definition, I would expect a PUT to replace the whole object, an object which has two fields (default_dashboard and quick_dashboard). So maybe the difference is in how the unreferenced field (quick_dashboard) is defined on this new account.