carsonyl / pypac

Find and use proxy auto-config (PAC) files with Python and Requests.
https://pypac.readthedocs.io
Apache License 2.0
71 stars 19 forks source link

Question about Windows PAC file #25

Closed BoboTiG closed 2 years ago

BoboTiG commented 6 years ago

Hello,

I was testing the PAC handler on Windows. When retrieving the file from the registry and it is a file://, this will not work: file://e:\\proxy.pac. To make it work, we must convert to file://e:/proxy.pac.

My question is: is it always in the good format in the registry? In your tests, you are not testing this form. Note that there is no issue here, I was just asking to prevent any regression in our product using your module :)

carsonyl commented 6 years ago

That's a good point. I just did a quick test: turns out Windows Internet Options does no validation on this field. Any input is stored as-is in the registry key. https://blogs.msdn.microsoft.com/ie/2006/12/06/file-uris-in-windows/ suggests file://e:\proxy.pac isn't valid for Windows file URLs, but this post classifies it as 'legacy'.

Looking more closely at https://en.wikipedia.org/wiki/File_URI_scheme, it looks like PyPAC incorrectly accepts file://c:/foo/bar.pac, when it should actually be file:///c:/foo/bar.pac.

BoboTiG commented 6 years ago

Thank you for the complete answer :) I let you close the issue, I do not know if you plan to change the current behavior.