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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>14831</bug_id>
          
          <creation_ts>2007-07-31 11:40:35 -0700</creation_ts>
          <short_desc>Status code of local failed GET request is different on Mac and Windows</short_desc>
          <delta_ts>2008-06-23 16:34:11 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>XML</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, PlatformOnly</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>10489</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jesse Costello-Good">jesse</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
    
    <cc>ap</cc>
    
    <cc>bedney</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3222</commentid>
    <comment_count>0</comment_count>
    <who name="Jesse Costello-Good">jesse</who>
    <bug_when>2007-07-31 11:40:35 -0700</bug_when>
    <thetext>var r = new XMLHttpRequest();
r.open(&quot;GET&quot;, &quot;nowhere.html&quot;, false);
r.send();
assertEquals(400, r.status);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3229</commentid>
    <comment_count>1</comment_count>
    <who name="Jesse Costello-Good">jesse</who>
    <bug_when>2007-07-31 11:50:31 -0700</bug_when>
    <thetext>*** Bug 14832 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3245</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-07-31 13:37:02 -0700</bug_when>
    <thetext>What version is this a regression from? I&apos;m getting the same result (-1100) in shipping 10.4.10 Safari/WebKit.

Clearly, it&apos;s wrong to expose a platform-specific error code as http status, but I would expect it to be 0 or 404 in this case. Do other browsers set the status of failed file:// request to 400?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3251</commentid>
    <comment_count>3</comment_count>
    <who name="Jesse Costello-Good">jesse</who>
    <bug_when>2007-07-31 14:43:37 -0700</bug_when>
    <thetext>Sorry for not being clear, sometimes it is difficult to figure out how Safari has changed given how much of our own code is written on top of it. 

What I meant to say is that Safari 3 beta 3.0.1 and the V3 branch up until that point throws an error for the code sample that I provided, while the latest nightlies just set the status code to -1100 on Mac and 112 on Windows.

Either throwing an error as in V3 beta or setting the status code to a consistent value in the 400s would be a fine resolution. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3279</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-08-01 00:38:20 -0700</bug_when>
    <thetext>We no longer raise an exception in this case, because it broke some Dashboard widgets. I would really love to fix this in a sensible way, but we may have to make Windows port match Mac first, and only fix the behavior of both after Safari 3 (it seems too late to change Mac behavior now).

Other cases to verify are trying to access a local directory instead of a file, and permissions problems.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3283</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-08-01 05:36:47 -0700</bug_when>
    <thetext>&lt;rdar://problem/5376642&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83862</commentid>
    <comment_count>6</comment_count>
    <who name="William J. Edney">bedney</who>
    <bug_when>2008-06-19 06:19:56 -0700</bug_when>
    <thetext>This was not a problem for me for the Safari 3.X series (i.e. the same &apos;failure&apos; code was being used for both plaforms), but is now definitely a problem for the Safari 4.X developer preview. Safari/Windows is just returning a 404, whether the directory exists or not (I&apos;m using this for &apos;directory existence detection&apos;).

Here is what I would propose (and which should obviously work cross-platform):

1. If the file:// URL points to a file and the file exists, the status code should return 200. The responseText/responseXML may very well be empty or null (meaning no content). If the file doesn&apos;t exist, it returns 404.

2. If the file://URL points to a directory and the directory exists (even if it has no files within it), the status code should return 200. If the directory doesn&apos;t exist, it returns 404.

Thoughts?

Cheers,

- Bill</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84201</commentid>
    <comment_count>7</comment_count>
    <who name="William J. Edney">bedney</who>
    <bug_when>2008-06-23 16:34:11 -0700</bug_when>
    <thetext>All -

I&apos;ll amend what I said earlier. It seems that this is also an issue for Safari/Windows 3.1X.

So Safari 3.1+ on Windows and Safari 4.0 developer preview all platforms are showing inconsistent and screwy values for this.

Cheers,

- Bill</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>