99designs / phumbor

A minimal PHP helper for Thumbor
MIT License
123 stars 43 forks source link

thumbor:WARNING Malformed URL #20

Open everlastin opened 9 years ago

everlastin commented 9 years ago

Why would we receive the malformed url error for the url below:

http://thumbor-server.com/5DlvHS38TZ3OTS2t7qKdKzN6lU4=/252x198/https://s3.amazonaws.com/bucket-name/rP1ysDPH_Photo_Apr_18_8_46_13_PM.jpg

http://thumbor-server.com/oV_9XVqUObpIX_ojRagaC3QnG54=/252x198/https%3A%2F%2Fs3.amazonaws.com%2Fbucket-name%2FrP1ysDPH_Photo_Apr_18_8_46_13_PM.jpg

Any thoughts?

harto commented 9 years ago

What version of Thumbor are you using? Which of the URLs causes the error?

everlastin commented 9 years ago

We are using version 4.12.2 and both URLs are failing. Unsafe URLs work without any issues which is good for development, but we want to make use of the secure URLs when we go live. Any thoughts?

harto commented 9 years ago

I'm not quite sure. Can you confirm that you get a different URL when you use thumbor-url to generate the URL? E.g.:

thumbor-url --key="<key>" --width=252 --height=198 https://s3.amazonaws.com/bucket-name/rP1ysDPH_Photo_Apr_18_8_46_13_PM.jpg
everlastin commented 9 years ago

Same result as the first URL above: /5DlvHS38TZ3OTS2t7qKdKzN6lU4=/252x198/https://s3.amazonaws.com/bucket-name/rP1ysDPH_Photo_Apr_18_8_46_13_PM.jpg

Could it be the version of Thumbor we are using?

harto commented 9 years ago

Perhaps your production Thumbor server is misconfigured. Is it definitely using the same key you're using to generate these URLs?

jbouzekri commented 9 years ago

Could it be because the last part of your url is not urlencoded ?

matthlavacka commented 8 years ago

How did you guys solve this? Having the same issue right now

matthlavacka commented 8 years ago

@harto That was our case. Probably might be worth mentioning it better in docs

roelvanduijnhoven commented 7 years ago

Mm. So we should manually encode the URLs we send to thes library?

If so: why is this not handled by the library? Looks like a bug to me!

mpdude commented 5 years ago

At least in newer Thumbor versions, the entire image URL should be urlencoded, since it is used as an URL part itself. This library should handle that.

mpdude commented 5 years ago

I think I've fixed this in https://github.com/webfactory/phumbor/pull/1, you could try webfactory/phumbor: ^1.2.3 on Composer.

bkonetzny commented 5 years ago

I can confirm that the fix in webfactory/phumbor: ^1.2.3 solves the issue. @mpdude Can you create a PR for this?

mpdude commented 5 years ago

Since this issue here is three years old and as #21 also tries to fix it (in a slightly different way), my assumption was that this project here has been abandoned.

That’s why I forked it (with a heavy heart) and re-published it as webfactory/phumbor.