11//
22// HTTPClientSessionTest.cpp
33//
4- // $Id: //poco/1.4/Net/testsuite/src/HTTPClientSessionTest.cpp#1 $
4+ // $Id: //poco/1.4/Net/testsuite/src/HTTPClientSessionTest.cpp#2 $
55//
66// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
77// and Contributors.
@@ -279,6 +279,27 @@ void HTTPClientSessionTest::testProxyAuth()
279279}
280280
281281
282+ void HTTPClientSessionTest::testBypassProxy ()
283+ {
284+ HTTPClientSession::ProxyConfig proxyConfig;
285+ proxyConfig.host = " proxy.domain.com" ;
286+ proxyConfig.port = 80 ;
287+ proxyConfig.nonProxyHosts = " localhost|127\\ .0\\ .0\\ .1" ;
288+
289+ HTTPClientSession s1 (" localhost" , 80 );
290+ s1.setProxyConfig (proxyConfig);
291+ assert (s1.bypassProxy ());
292+
293+ HTTPClientSession s2 (" 127.0.0.1" , 80 );
294+ s2.setProxyConfig (proxyConfig);
295+ assert (s2.bypassProxy ());
296+
297+ HTTPClientSession s3 (" www.appinf.com" , 80 );
298+ s3.setProxyConfig (proxyConfig);
299+ assert (!s3.bypassProxy ());
300+ }
301+
302+
282303void HTTPClientSessionTest::setUp ()
283304{
284305}
@@ -305,6 +326,7 @@ CppUnit::Test* HTTPClientSessionTest::suite()
305326 CppUnit_addTest (pSuite, HTTPClientSessionTest, testKeepAlive);
306327 CppUnit_addTest (pSuite, HTTPClientSessionTest, testProxy);
307328 CppUnit_addTest (pSuite, HTTPClientSessionTest, testProxyAuth);
329+ CppUnit_addTest (pSuite, HTTPClientSessionTest, testBypassProxy);
308330
309331 return pSuite;
310332}
0 commit comments