Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAC read #33

Open
GoogleCodeExporter opened this issue May 1, 2015 · 1 comment
Open

PAC read #33

GoogleCodeExporter opened this issue May 1, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Reading failed with file URL containing a hostname such as :
file://localhost/Users/gaellalire/proxies.pac

readPacFileContent method in UrlPacScriptSource should not try to create a file 
from an URL

A possible fix below

            Reader reader = null;
            if (scriptUrl.indexOf(":/") == -1) {
                reader = new FileReader(scriptUrl);
            } else {
                reader = new InputStreamReader(new URL(scriptUrl).openStream());
            }
            BufferedReader r = new BufferedReader(reader);

Original issue reported on code.google.com by [email protected] on 13 Nov 2012 at 10:10

@GoogleCodeExporter
Copy link
Author

Hi,
I wasnt aware that this kind of URL is a valid one.
I just played around with this and it really seems that you can enter what ever 
you want as a hostname. It will be treated as localhost if and open the 
specified folder in Firefox at least on Linux where I have tested this.

I will try to implement a fix for this. The problem with the URL Input stream 
is that this will fail for some UNC file urls and it would introduce other 
problems. I will think to to implement this.

Thanks for reporting this.

- Rossi
P.S. Sorry for the late respond. I was very busy with other stuff.

Original comment by [email protected] on 3 Dec 2012 at 7:41

  • Changed state: Accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant