Bug 73328 - Proxy settings value cannot be added
Summary: Proxy settings value cannot be added
Status: RESOLVED FIXED
Alias: None
Product: kcontrol
Classification: Miscellaneous
Component: kcmproxy (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 74159 75605 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-01-23 15:13 UTC by Fulvio Bertino
Modified: 2004-02-20 16:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fulvio Bertino 2004-01-23 15:13:01 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Gentoo Packages

When I try to add a server name of my intranet to the list of the host that shouldn't use the proxy, I cannot insert it if it hasn't a dot in the url.
I mean, if the domain is not specified, the value will not be inserted: the value "dcsv01" will not be taken, while the value "dcsv01.somedomain.it" will be added.
Comment 1 Fulvio Bertino 2004-01-23 15:16:21 UTC
Ah, I forgot... my compiler is :
Thread model: posix
gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)

uname -a gives:
Linux 2.4.22-ck2 #6 Mon Nov 10 11:10:15 CET 2003 i686 Pentium III (Coppermine) GenuineIntel GNU/Linu
Comment 2 Dawit Alemayehu 2004-02-20 03:27:59 UTC
*** Bug 74159 has been marked as a duplicate of this bug. ***
Comment 3 Dawit Alemayehu 2004-02-20 03:28:19 UTC
*** Bug 75605 has been marked as a duplicate of this bug. ***
Comment 4 Dawit Alemayehu 2004-02-20 14:36:17 UTC
CVS commit by adawit: 

- Fix BR# 73328.
- If the user presses cancel in the proxy exception dialog, do nothing.

CCMAIL: 73328-done@bugs.kde.org


  M +20 -9     kmanualproxydlg.cpp   1.23.2.1


--- kdebase/kcontrol/kio/kmanualproxydlg.cpp  #1.23:1.23.2.1
@@ -158,12 +158,16 @@ void KManualProxyDlg::setProxyData( cons
       if ((*it).lower() != "no_proxy" && !(*it).isEmpty())
       {
-        // Validate the NOPROXYFOR entries and ignore them if they are 
-        // not valid or legitimate URLs.
+        // Validate the NOPROXYFOR entries and use only hostnames if the entry is 
+        // a valid or legitimate URL. NOTE: needed to catch manual manipulation
+        // of the proxy config files...
         QStringList filters;
         filters << "kshorturifilter" << "localdomainfilter";
+        
         KURL url = *it;
-        if ((url.isValid() || KURIFilter::self()->filterURI(url, filters)) &&
-            !url.host().isEmpty())
-          (void) new QListViewItem( dlg->lvExceptions, url.host() );
+        if ( !url.isValid() )
+          KURIFilter::self()->filterURI(url, filters);
+          
+        QString exception = (url.isValid() && !url.host().isEmpty()) ? url.host() : url.url();                
+        (void) new QListViewItem( dlg->lvExceptions, exception );
       }
     }
@@ -413,10 +417,18 @@ void KManualProxyDlg::newPressed()
   KURL result = KInputDialog::getText (i18n("New Exception"), msg);
   
+  // If the user pressed cancel, do nothing...
+  if (result.isEmpty())
+    return;
+  
   QStringList filters;
   filters << "kshorturifilter" << "localdomainfilter";
   
-  if ( result.isValid() || KURIFilter::self()->filterURI(result, filters) )
-  {
-    QString exception = result.host();
+  // If the typed URL is malformed, attempt to filter it in order
+  // to check its validity...
+  if ( !result.isValid() )
+    KURIFilter::self()->filterURI(result, filters);
+    
+  QString exception = (result.isValid() && !result.host().isEmpty()) ? result.host() : result.url();
+  
     if ( !handleDuplicate( exception ) )
     {
@@ -425,5 +437,4 @@ void KManualProxyDlg::newPressed()
     }
   }
-}
 
 void KManualProxyDlg::changePressed()


Comment 5 Marc Schiffbauer 2004-02-20 16:15:56 UTC
I think it should be possible to just enter hostnames and if URL, hostname or whatever the user entered is not valid a Message should notify the user about the wrong input.

The way it is now  a user assumes a bug in Konqueror when trying to enter some intranet hosts where nno prxy should be used...