Giter VIP home page Giter VIP logo

Comments (11)

paulstraw avatar paulstraw commented on June 1, 2024

Hey there @adamn. The library is designed to accept unencoded URLs. If you pass in an unencoded URL, this should work as expected. Please let me know if you're still running into issues!

from imgix-python.

adamn avatar adamn commented on June 1, 2024

http://www.brookings.edu/~/media/research/images/l/lk%20lo/london_bigben_flags001/london_bigben_flags001_16x9.jpg is the url I have. If I convert the %20 to a + then the signature will work but the underlying url will not exist. If I don't convert it, the url does not get signed correctly and the Imgix server returns a 401. Is there any solution?

from imgix-python.

paulstraw avatar paulstraw commented on June 1, 2024

Yes. The issue here isn't the space character itself, but that part of the URL being passed has been encoded, while part hasn't (the /, ~, and other characters). To make this a bit more straightforward, I've just published version 1.1.1, which automatically unescapes passed URLs before re-escaping them. Let me know if you have any more questions!

from imgix-python.

adamn avatar adamn commented on June 1, 2024

Cheers!

from imgix-python.

adamn avatar adamn commented on June 1, 2024

Sorry, this still doesn't work for me. I still get a 'bad request' on the imgix server because of the bad signature. Also, it looks like your test asserts the url, not the signature (which is the problem since I'm getting a 401 - i.e. the signature isn't correct).

from imgix-python.

paulstraw avatar paulstraw commented on June 1, 2024

Hey @adamn, can you send through the new URL that's being generated?

from imgix-python.

adamn avatar adamn commented on June 1, 2024

It's in the initial part of the ticket. Sorry don't have it with me right now.

On Jun 30, 2016, at 12:52 PM, Paul Straw [email protected] wrote:

Hey @adamn, can you send through the new URL that's being generated?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

from imgix-python.

paulstraw avatar paulstraw commented on June 1, 2024

Hmm, you shouldn't be getting the same output with the 1.1.1 version of the library. When you're able, could you let me know what the new URL you're getting is? I can generate it on my end, but just want to make sure there's not anything else going on here.

from imgix-python.

adamn avatar adamn commented on June 1, 2024

These are the steps for 1.1.1. The final url returns a 400 now. Just to note, I used to get a 401 with 1.1.0

>>> import imgix
>>> imgix._version.__version__
'1.1.1'
>>> image_url_builder = imgix.UrlBuilder(IMGIX_URL, sign_key=IMGIX_SIGN_KEY, use_https=True)
>>> image_url = 'http://www.brookings.edu/~/media/research/images/l/lk%20lo/london_bigben_flags001/london_bigben_flags001_16x9.jpg'
>>> options = {'w': 260, 'fit': 'crop', 'crop': 'entropy'}
>>> image_url_builder.create_url(image_url, options)
'https://factr-url.imgix.net/http%3A%2F%2Fwww.brookings.edu%2F%7E%2Fmedia%2Fresearch%2Fimages%2Fl%2Flk%20lo%2Flondon_bigben_flags001%2Flondon_bigben_flags001_16x9.jpg?crop=entropy&fit=crop&ixlib=python-1.1.1&w=260&s=c09df394cd0c270f82afaa57c29bab47'

from imgix-python.

paulstraw avatar paulstraw commented on June 1, 2024

Okay, after a bit more digging on this, I've realized that the encoded space character was a red herring. The encoding of the space was actually correct before. The encoding that was actually messed up was the ~. (Working URL: https://factr-url.imgix.net/http%3A%2F%2Fwww.brookings.edu%2F~%2Fmedia%2Fresearch%2Fimages%2Fl%2Flk%2520lo%2Flondon_bigben_flags001%2Flondon_bigben_flags001_16x9.jpg?crop=entropy&fit=crop&ixlib=python-1.1.1&w=260&s=02e201bd94fc0241051f540e6149699d)

I'm getting this all patched up, and will have a 1.1.2 out shortly.

from imgix-python.

paulstraw avatar paulstraw commented on June 1, 2024

Alrighty @adamn, I just bumped this and verified with your example URL. Should be good to go!

from imgix-python.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.