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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>10327</bug_id>
          
          <creation_ts>2010-08-09 12:34:28 +0000</creation_ts>
          <short_desc>supported URL schemes in open()</short_desc>
          <delta_ts>2011-12-20 19:44:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>XHR</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>ap</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>37302</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2010-08-09 12:34:28 +0000</bug_when>
    <thetext>I would like to have clearer language for URLs regarding their supported &lt;scheme&gt; component.

I.e. I would like it to be clear from the draft what happens if you use any of the following:

  &quot;mailto:foo@example.org&quot;
  &quot;about:blank&quot;
  &quot;tag:example.org&quot;
  &quot;tel:+316...&quot;
  &quot;data:text/html,...&quot;

My preferred solution would be to throw unless the URL scheme is one of a whitelist which contains:

  http
  https
  ftp
  file (implementation specific, must throw a SYNTAX_ERR if the current scheme is not file)

We can add to this whitelist in the future, such as the blob URL scheme.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37304</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-08-09 12:43:46 +0000</bug_when>
    <thetext>I don&apos;t see why this whitelist idea is desirable, and doing this would certainly break existing Gecko extension XMLHttpRequest consumers.

Why shouldn&apos;t other protocols be supported, exactly?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37305</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2010-08-09 12:49:43 +0000</bug_when>
    <thetext>We could solve this any number of ways, but for non-extension web content it would be good to have a clear answer to what should happen to the example cases I gave (i.e. mailto URLs and such). Having a whitelist makes the answer very simple. Having it open ended does not and could lead to interoperability problems.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37307</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-08-09 12:56:02 +0000</bug_when>
    <thetext>Fair enough.

For what it&apos;s worth, Gecko&apos;s current behavior is that every protocol implementation has an associated boolean flag indicating whether the protocol returns data.  Protocols that do not end up throwing when open() is called on a URI for those protocols.  Unknown protocols are presumed to not return data (since we have no way to get the data).

So for your examples in comment 0, and assuming no extensions that implement additional protocols are installed, we would throw on everything except about: and data:.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37310</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2010-08-09 14:37:31 +0000</bug_when>
    <thetext>Opera and WebKit pass through URLs that are legal and fail at the request layer (i.e. after send() is invoked) for unsupported schemes. Opera supports data URLs.

The concept Mozilla has could work, but a) is not part of URI scheme registry so will be difficult and b) cross-origin requests for web content can only work by virtue of CORS which only works for HTTP.

I think the solution here then is to remove the restriction on schemes in the open() algorithm. If we also remove the non same-origin restriction there it follows naturally that everything fails in the request layer as these URLs are not same-origin and cannot support CORS.

In proprietary environments such as extensions these URLs could still do something useful as presumably CORS is not (always) followed there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37351</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2010-08-11 11:32:20 +0000</bug_when>
    <thetext>Proposal for CfC: paragraph 3 of comment 4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37356</commentid>
    <comment_count>6</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-08-11 15:15:57 +0000</bug_when>
    <thetext>That sounds reasonable to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37932</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2010-08-26 13:08:31 +0000</bug_when>
    <thetext>Fixed! (Also for redirects.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>