volkertb / proxy-vole

Automatically exported from code.google.com/p/proxy-vole
0 stars 0 forks source link

PAC read #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 gael.lal...@gmail.com on 13 Nov 2012 at 10:10

GoogleCodeExporter commented 9 years ago
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 rosstaus...@googlemail.com on 3 Dec 2012 at 7:41