tommiionfire / proxy-vole

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

mydomain.com/test will be treated as IP address in DefaultWhiteListParser #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start Ubuntu (in my case 12.04)
2. Open /home/<username>/.gconf/system/http_proxy/%conf.xml
3. Add the following to ignored hosts:
<li type="string">
<stringvalue>mydomain.com/test</stringvalue>
</li>
4. Log out and log in again
5. Execute the code below

As alternative to step 2 and 3 you can also add the string 'mydomain.com/test' 
to the ignored hosts via the dconf-editor in the UI. You can find the entry for 
this under system/proxy in the dconf-editor. Relogin is also needed in this 
case.

import com.btr.proxy.search.desktop.gnome.GnomeProxySearchStrategy;
import com.btr.proxy.util.ProxyException;

public class ProxyExceptionTest {

    /**
     * @param args
     * @throws ProxyException 
     */
    public static void main(String[] args) throws ProxyException {
        new GnomeProxySearchStrategy().getProxySelector();

    }

}

What is the expected output? What do you see instead?
The ignored host "mydomain.com/test" should be treated as hostname and not as 
IP address. But I get the following exception:

Exception in thread "main" java.lang.NumberFormatException: For input string: 
"test"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:481)
    at java.lang.Integer.parseInt(Integer.java:514)
    at com.btr.proxy.selector.whitelist.IpRangeFilter.<init>(IpRangeFilter.java:42)
    at com.btr.proxy.selector.whitelist.DefaultWhiteListParser.parseWhiteList(DefaultWhiteListParser.java:39)
    at com.btr.proxy.selector.whitelist.ProxyBypassListSelector.<init>(ProxyBypassListSelector.java:54)
    at com.btr.proxy.search.desktop.gnome.GnomeProxySearchStrategy.getProxySelector(GnomeProxySearchStrategy.java:114)
    at ProxyExceptionTest.main(ProxyExceptionTest.java:12)

What version of the product are you using? On what operating system?
proxy-vole: 20120920
OS: Ubuntu 12.04

Please provide any additional information below.
I think the determination of IP addresses in the DefaultWhiteListParser is 
wrong. An IP address will be determined by just checking if the string contains 
a / character. In my opinion this should be made more robust. Maybe with a 
regex checker or something similar.

Original issue reported on code.google.com by briem.l...@gmail.com on 27 Sep 2012 at 9:23

GoogleCodeExporter commented 8 years ago
Hi,
I will look into this to find a better way for the IP address parsing.
Thanks for reporting this issue. 

Have fun,
- Rossi

Original comment by rosstaus...@googlemail.com on 27 Sep 2012 at 10:50

GoogleCodeExporter commented 8 years ago
I have a similar problem when the list of ignored hosts include "http://10.*". 
The DefaultWhiteListParser will treat this as an IP address because of the 
presence of the / characters. I hope you will consider this case as well when 
you look into a solution of this issue.

Thanks.

Original comment by ksko...@gmail.com on 2 Oct 2012 at 6:44

GoogleCodeExporter commented 8 years ago
Hi,
I have just released a new version. This version also includes some improvments 
regarding the handling of "no proxy" definitions. This should also cover these 
reported problems.

Have fun,
- Rossi

Original comment by rosstaus...@googlemail.com on 3 Dec 2012 at 7:38