<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>134753</bug_id>
          
          <creation_ts>2006-09-27 18:15:48 +0000</creation_ts>
          <short_desc>Problem with cookies in konqueror when server specified as IP adress.</short_desc>
          <delta_ts>2007-09-01 23:03:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kio</product>
          <component>http</component>
          <version>unspecified</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Anton">bond-cash</reporter>
          <assigned_to name="Unassigned bugs">unassigned-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>473268</commentid>
    <comment_count>0</comment_count>
    <who name="Anton">bond-cash</who>
    <bug_when>2006-09-27 18:15:48 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.5.2)
Installed from:    Gentoo Packages
Compiler:          Gentoo-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 i686 
OS:                Linux

When server, wich named by IP adress, sets cookie, konqueror saves it but doesn&apos;t send it back. When server named by symbolic domain name - everything are correct.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>543946</commentid>
    <comment_count>1</comment_count>
    <who name="Dawit Alemayehu">adawit</who>
    <bug_when>2007-09-01 16:33:41 +0000</bug_when>
    <thetext>Sorry, priority and severity level was changed by mistake.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>544002</commentid>
    <comment_count>2</comment_count>
    <who name="Dawit Alemayehu">adawit</who>
    <bug_when>2007-09-01 23:03:22 +0000</bug_when>
    <thetext>SVN commit 707427 by adawit:


- Send back saved cookies that came from ip-address based hosts.
- Added a test case to exercise given secnairo above.

BUG: 134753


 M  +2 -10     kcookiejar.cpp  
 M  +10 -0     tests/cookie.test  


--- trunk/KDE/kdelibs/kioslave/http/kcookiejar/kcookiejar.cpp #707426:707427
@@ -79,6 +79,7 @@
 
 #define MAX_COOKIES_PER_HOST 25
 #define READ_BUFFER_SIZE 8192
+#define IP_ADDRESS_EXPRESSION &quot;(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)&quot;
 
 // Note with respect to QString::fromLatin1( )
 // Cookies are stored as 8 bit data and passed to kio_http as
@@ -614,17 +615,8 @@
     // Return numeric IPv4 addresses as is...
     if ((_fqdn[0] &gt;= &apos;0&apos;) &amp;&amp; (_fqdn[0] &lt;= &apos;9&apos;))
     {
-       bool allNumeric = true;
-       for(int i = _fqdn.length(); i--;)
+       if (_fqdn.find(QRegExp(IP_ADDRESS_EXPRESSION)) &gt; -1)
        {
-          if (!strchr(&quot;0123456789:.&quot;, _fqdn[i].toLatin1()))
-          {
-             allNumeric = false;
-             break;
-          }
-       }
-       if (allNumeric)
-       {
           _domains.append( _fqdn );
           return;
        }
--- trunk/KDE/kdelibs/kioslave/http/kcookiejar/tests/cookie.test #707426:707427
@@ -149,3 +149,13 @@
 CONFIG AcceptSessionCookies true
 COOKIE ACCEPT http://www.foobar.com Set-Cookie: from=foobar.com; domain=bar.com; Path=&quot;/&quot;
 CHECK http://bar.com
+## Check cookies with IP address hostnames
+COOKIE ASK http://192.168.0.1 Set-Cookie: name1=value1; Path=&quot;/&quot;; expires=%NEXTYEAR%
+COOKIE ASK http://192.168.0.1 Set-Cookie: name11=value11; domain=&quot;test.local&quot;; Path=&quot;/&quot;; expires=%NEXTYEAR%
+COOKIE ASK http://192.168.0.1:8080 Set-Cookie: name2=value2; Path=&quot;/&quot;; expires=%NEXTYEAR%
+COOKIE ASK https://192.168.0.1 Set-Cookie: name3=value3; Path=&quot;/&quot;; expires=%NEXTYEAR%; secure
+CHECK http://192.168.0.1 Cookie: name11=value11; name1=value1
+CHECK http://192.168.0.1:8080 Cookie: name2=value2
+CHECK https://192.168.0.1 Cookie: name3=value3; name11=value11; name1=value1
+CHECK http://192.168.0.10
+CHECK http://192.168.0
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>