URL Upload don't work

17 views
Skip to first unread message

Alvin FREY

unread,
Nov 25, 2016, 5:09:14 AM11/25/16
to astrometry
Hello everyone,

I recently tried to use the API with the url_upload i made a request to this URL : http://nova.astrometry.net/api/url_upload

Using this parameters : request-json:{"session": "MYSESSION", "url": "https://puu.sh/qO9WO/701b328cde.jpg", "scale_units": "degwidth", "scale_lower": 0.5, "scale_upper": 1.0, "center_ra": 290, "center_dec": 11, "radius": 2.0 }

But I get this error code : 403 Forbidden

Thanks for your help

Dustin Lang

unread,
Nov 25, 2016, 3:26:37 PM11/25/16
to astrometry
Hi,

We use the python 'urllib' module to retrieve URL submissions (the nova server has to download your image from the URL you supplied).

Testing this from the command line, I get:

$ python -c "import urllib; f = urllib.urlopen('https://puu.sh/qO9WO/701b328cde.jpg'); print f.info(); print 'Code:', f.getcode()"
Date: Fri, 25 Nov 2016 20:23:36 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Set-Cookie: __cfduid=d6cdd49f0cc0c4f80d8f292fc02f291641480105416; expires=Sat, 25-Nov-17 20:23:36 GMT; path=/; domain=.puu.sh; HttpOnly
Cache-Control: max-age=10
Expires: Fri, 25 Nov 2016 20:23:46 GMT
X-Frame-Options: SAMEORIGIN
Server: cloudflare-nginx
CF-RAY: 3077d1c2fa894716-EWR

Code: 403


So the puu.sh web server is sending a "403" (permission denied) error message when it receives a request from the urllib module.

I checked and "wget" (and firefox web browser) work okay for this URL -- so this web server is discriminating based on the client's request headers.  Which is naughty.

Not much I can do about it...

cheers,
--dustin



Reply all
Reply to author
Forward
0 new messages