5 Jun 2017 |
@gitter_keflavich:matrix.org | this should not happen: | 22:30:04 |
@gitter_keflavich:matrix.org | ``` | 22:30:04 |
@gitter_keflavich:matrix.org | In [40]: result1 = S.post('http://archive.noao.edu/search/send_simple_query', data={'ra':148.888, 'dec':69.065, 'searchbox':30.0,},) | 22:30:04 |
@gitter_keflavich:matrix.org | Redacted or Malformed Event | 22:30:04 |
@gitter_keflavich:matrix.org | In [41]: result1.request.method | 22:30:05 |
@gitter_keflavich:matrix.org | Out[41]: 'GET' | 22:30:05 |
@gitter_keflavich:matrix.org | ``` | 22:30:05 |
@gitter_keflavich:matrix.org | ok, that's a redirect issue: | 22:31:46 |
@gitter_keflavich:matrix.org | ``` | 22:31:46 |
@gitter_keflavich:matrix.org | In [43]: result1 = S.post('http://archive.noao.edu/search/send_simple_query', data={'ra':148.888, 'dec':69.065, 'searchbox':30.0,}, allow_redirects=False) | 22:31:47 |
@gitter_keflavich:matrix.org | Redacted or Malformed Event | 22:31:47 |
@gitter_keflavich:matrix.org | In [44]: result1 | 22:31:47 |
@gitter_keflavich:matrix.org | Out[44]: <Response [302]> | 22:31:47 |
@gitter_keflavich:matrix.org | ``` | 22:31:47 |
@gitter_keflavich:matrix.org | there is something really tricky going on. | 22:35:25 |
@gitter_keflavich:matrix.org | if you go to http://archive.noao.edu/search/list_resources in the same browser that you've run a query already, does it show you the results of that query? It does for me, which implies it is using cookies (and only cookies) to retrieve the data. | 22:40:22 |
@gitter_ayushyadav:matrix.org | Yeah, I see the same thing. tried taking the cookies and tried sending the cookie value and the _session_id for the next query but it did not work for me. | 22:42:25 |
@gitter_keflavich:matrix.org | ahh, I seeā¦ I think they're passing tokens around | 22:42:41 |
@gitter_keflavich:matrix.org | hrm | 22:42:42 |
@gitter_ayushyadav:matrix.org | (edited) ... thing. tried ... => ... thing. I also tried ... | 22:42:42 |
@gitter_keflavich:matrix.org | I see things like . X-CSRF-Token:+UNUxNBVOawd9AwIk5PS8DfLp6/1yPxD3DFIhetvA9s= , but I don't know where they are produced.... | 22:43:08 |
@gitter_ayushyadav:matrix.org | Any ideas how to work this out? | 22:48:29 |
@gitter_keflavich:matrix.org | guess and check | 22:49:29 |
@gitter_keflavich:matrix.org | I'm trying a bunch of different things | 22:49:32 |
@gitter_keflavich:matrix.org | I've concluded that it has to do with the cookie | 22:49:39 |
@gitter_keflavich:matrix.org | because I can get good data if I pass (the cookie that I've received via the web browser) into requests | 22:50:14 |
@gitter_keflavich:matrix.org | noao is giving us bad cookies. | 22:50:28 |
@gitter_keflavich:matrix.org | it looks like they are issuing a new cookie every time something is submitted. That's not right. | 23:01:44 |
@gitter_ayushyadav:matrix.org | Another interesting thing is that if you mess up with the cookies in the browser then the entire site seems to break. Giving Service not available errors or in one case leading to the link being looped back to the same page. | 23:07:08 |
@gitter_keflavich:matrix.org | yep | 23:09:51 |