<?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>19236</bug_id>
          
          <creation_ts>2012-10-03 00:17:03 +0000</creation_ts>
          <short_desc>Enable CORS on entire site</short_desc>
          <delta_ts>2012-10-04 00:23:17 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>webplatform.org</product>
          <component>infrastructure</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Eric Bidelman">ericbidelman</reporter>
          <assigned_to name="Doug Schepers">schepers</assigned_to>
          <cc>paul.irish</cc>
    
    <cc>rlane32</cc>
    
    <cc>team-webplatform-admin</cc>
          
          <qa_contact name="public-webplatform-bugs list">public-webplatform-bugs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>75171</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Bidelman">ericbidelman</who>
    <bug_when>2012-10-03 00:17:03 +0000</bug_when>
    <thetext>http://enable-cors.org!

I&apos;ve heard a ton of interest from developers that want to integrate IDEs, tools, widgets, etc. with the web docs. webplatform&apos;s goal is to the be canonical docs for the web, we should allow people to access them
any way they see fit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75178</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Irish">paul.irish</who>
    <bug_when>2012-10-03 01:02:20 +0000</bug_when>
    <thetext>Not sure if we serve on apache but this should do it..


&lt;IfModule mod_headers.c&gt;
    Header set Access-Control-Allow-Origin &quot;*&quot;
&lt;/IfModule&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75183</commentid>
    <comment_count>2</comment_count>
    <who name="Ryan Lane">rlane32</who>
    <bug_when>2012-10-03 01:15:36 +0000</bug_when>
    <thetext>I worry about enabling this via apache for every request...

We can do it via filematch (which we just did for fonts), and can do it for MediaWiki&apos;s api using this:

http://www.mediawiki.org/wiki/Manual:$wgCrossSiteAJAXdomains

I just enabled that as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75187</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Bidelman">ericbidelman</who>
    <bug_when>2012-10-03 01:37:28 +0000</bug_when>
    <thetext>There&apos;s info on security here:
http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity

...there can be a perf overhead with the preflight request, but that it minimal.

Is it possible to open it up to only /wiki/tutorial pages for starters?

Also, if we go the route of whitelisting domains, how can folks add/suggest new ones?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75260</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Bidelman">ericbidelman</who>
    <bug_when>2012-10-03 21:50:10 +0000</bug_when>
    <thetext>More info here:
http://monsur.hossa.in/2012/09/07/thoughts-on-the-cors-preflight-cache.html

Monsur has done experiments with CORS. He says:

&quot;serving the header should not be costly at all
i mean, you are adding, what, 30 bytes per request&quot;

The worry is that you open up an &quot;API&quot; for folks to use. However, there&apos;s
also nothing top stop folks from iframing in our pages and creating extra
load on the server.

If the server load is worry, has there been any thought in allowing folks
to request as page as JSON?...and only enable the CORs headers for those
types of requests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75261</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Bidelman">ericbidelman</who>
    <bug_when>2012-10-03 21:57:29 +0000</bug_when>
    <thetext>More info from Monsur:

&quot;honestly, i don&apos;t see it as being a big perf hit as long as devs play within the rules.. besides, if a dev is being malicious, they can find better ways that cors to do it (e.g. just write a script to hit the front page over and over)&quot;

At the very least, I&apos;d like us to consider setting up a form or page where users can
suggestion their domain if we go the whitelisting route.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75281</commentid>
    <comment_count>6</comment_count>
    <who name="Eric Bidelman">ericbidelman</who>
    <bug_when>2012-10-04 00:23:17 +0000</bug_when>
    <thetext>Just found out that GET requests without simple headers (http://www.w3.org/TR/cors/#simple-header)
don&apos;t incur preflight requests.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>