Closed paulvt closed 10 years ago
This gem uses URI.parse
from Ruby standard library. As you can see wpad://
is invalid URI, that's why error is thrown.
I checked second url "pac+http://host/some/pac_file.pac" - it is parsed without error.
Why would you want to allow invalid URI in proxy?
Because URI.parse
doesn't handle it, doesn't mean it's an invalid URI. But, indeed, it's a libproxy convention that Picasa shouldn't have to support. Even if the PAC URI is parsed correctly, the proxy is derived by evaluating the request URL in the JS contained in the PAC file, so in this case the URI shouldn't be used.
My main problem is that proxy is set at loadtime, not at runtime... I am not sure whether this is related to HTTParty's way of setting up things, but al other social media libs I use allow for runtime proxy setup.
httparty options are added at load time: https://github.com/morgoth/picasa/blob/master/lib/picasa/http.rb#L26 I think it should be possible to setup those options at run time. I will investigate it
In our application we use libproxy to be able to support all kinds of weird proxy setups. Using libproxy this means that the
https_proxy
environment can contain "wpad://" or "pac+http://host/some/pac_file.pac".While IMO the Picasa library shouldn't be have to support or use libproxy, I think it shouldn't crash loadtime:
With other libraries (instagram, flickr, etc.) we usually do a manual setup of the proxy, but we now don't get this far as already the "require" crashes.