On 26/01/2011, at 14:15, Lee Connell wrote: > On Wed, Jan 26, 2011 at 4:24 AM, Alvaro Lopez Ortega <[email protected]> > wrote: > On 25/01/2011, at 20:44, Lee Connell wrote: > >> This is the URL I generated and sent back to the client: >> http://www.example.com:81/secure_files/457c02a1ad1d92c5be833e163b3cf87b/4d3f25ac/pass.txt >> >> I get a 403 Forbidden, you have no access to the requested URL. >> >> If I wait the default 60 seconds i get: >> 410 Gone, The requested URL >> /secure_files/457c02a1ad1d92c5be833e163b3cf87b/4d3f25ac/pass.txt is no >> longer available on this server and there is no forwarding address >> >> How come I am being denied initially? > > > The MD5 was incorrect, most likely because of how you built the raw string > from your script. > > > This is what I used to generate the url, same as what is available in the > docs. > > def generate_download(filename): > secret = 'mysecret' > prefix = '/secure_files' > t = '%08x' % (time.time()) > return prefix + "/%s/%s/%s" % (hashlib.md5(secret + filename + > t).hexdigest(), t, filename)
Usually the problem is related to duplicated or missing slash characters in the intermediate strings. I'd personally start by checking the value of the following strings: - secret + filename + t - prefix + "/%s/%s/%s" % (hashlib.md5(secret + filename + t).hexdigest(), t, filename) -- Octality http://www.octality.com/
_______________________________________________ Cherokee mailing list [email protected] http://lists.octality.com/listinfo/cherokee
