Open ryanwi opened 8 years ago
The shortener should support signed requests, you might want to send the URL as a POST parameter instead of being in the URL.
Technically speaking the image source should be URL encoded due to the presence of a http://
section.
https://github.com/thumbor-community/shortener/blob/master/tc_shortener/handlers/shortener.py#L65 should let you do a JSON POST to /shortener
with a payload containing a url
parameter.
curl -X "POST" --data "url=/oNfnJ36sAQ-CEMVDFTgZ-DfpZ0Y=/360x220/smart/https://82bda53d6c07527f63d4-bb56d6c11261cc2ec250960b8872f9f2.ssl.cf1.rackcdn.com/roster_full_photos/168/original/e44118bf-cf2e-4777-8810-dea67f3e413f.jpg" "http://localhost:8888/shortener"
There should have been vows/tests covering that. Sorry about the lack of documentation.
Something seems to be broken, investigating.
Thanks for looking. Sending the url
param in the POST body did not seem to be working, is that what you're investigating?
Yeah in part. I'm currently adding new tests and fixing a few issues you recently found.
For example the shortened url when preserving the file name will use the path basename instead of the full URL.
Does the shortener support signed requests?
Given a standard thumbor signed request, this works fine:
But, shortening the url fails:
With the logs as follows:
From what I can tell, the call to
yield self.check_image(options)
will fail because the method does not account forshortener
being in the url. It will look like this: