<?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>50773</bug_id>
          
          <creation_ts>2010-12-09 11:43:34 -0800</creation_ts>
          <short_desc>CORS origin header not set on GET when content type request header is set</short_desc>
          <delta_ts>2011-02-04 15:00:56 -0800</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>525.x (Safari 3.2)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 7</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="Sky Sanders">sky.sanders</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>levin</cc>
    
    <cc>martin</cc>
    
    <cc>mike</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>319628</commentid>
    <comment_count>0</comment_count>
    <who name="Sky Sanders">sky.sanders</who>
    <bug_when>2010-12-09 11:43:34 -0800</bug_when>
    <thetext>This seems to only be an issue when source is localhost
reproduced on latest Chrome and Safari


Here is a POST (origin is set)

POST /RESTWebServices/session HTTP/1.1
Host: ec2-174-129-8-69.compute-1.amazonaws.com
Referer: http://localhost:10042/documentation/samples/ciapijs-newsdetail-steps.sample.aspx
Accept: */*
Accept-Language: en-US
Origin: http://localhost:10042
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5
X-Requested-With: XMLHttpRequest
Content-Type: application/json; charset=UTF-8
Accept-Encoding: gzip, deflate
Content-Length: 45
Connection: keep-alive
Connection: keep-alive

{&quot;UserName&quot;:&quot;CC735158&quot;,&quot;Password&quot;:&quot;password&quot;}
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 50
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: X-Requested-With, Content-Type
Access-Control-Max-Age: 1728000
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sun, 05 Dec 2010 12:48:47 GMT

{&quot;Session&quot;:&quot;D2FF3E4D-01EA-4741-86F0-437C919B5559&quot;}


Here is a GET (Origin is missing)

GET /a valid url
Host: ec2-174-129-8-69.compute-1.amazonaws.com
Connection: keep-alive
Referer: http://localhost:10042/documentation/samples/ciapijs-newsdetail-steps.sample.aspx
X-Requested-With: XMLHttpRequest
Content-Type: application/json
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3


HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 1152
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sun, 05 Dec 2010 12:44:25 GMT

{ valid json respose }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>319705</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-12-09 14:02:18 -0800</bug_when>
    <thetext>We don&apos;t usually send Origin with GET requests.  We do send it for XMLHttpRequest if we&apos;re using CORS.  Maybe we&apos;re not using CORS for some reason?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>319711</commentid>
    <comment_count>2</comment_count>
    <who name="Sky Sanders">sky.sanders</who>
    <bug_when>2010-12-09 14:13:58 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; We don&apos;t usually send Origin with GET requests.  We do send it for XMLHttpRequest if we&apos;re using CORS.  Maybe we&apos;re not using CORS for some reason?

The request logs shown represent XHR requests that should indeed be CORS.

The POST behaves as expected while the GET does not.  Again, this appears to only happen when the source is http://localhost.

This also introduces a catch 22 situation with a CORS scenario in which the source and target are both on localhost with different port numbers.

WebKit XHR demands CORS response headers due to the different port but it does not send an Origin request header which is the trigger for a server to send the response headers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>319714</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-12-09 14:18:17 -0800</bug_when>
    <thetext>Indeed.  We&apos;re supposed to send Origin with CORS requests.  If we&apos;re not doing that, its our bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>321449</commentid>
    <comment_count>4</comment_count>
    <who name="Sky Sanders">sky.sanders</who>
    <bug_when>2010-12-13 14:52:28 -0800</bug_when>
    <thetext>UPDATE: 
it is not the source (localhost) that is causing the dilemma rather setting Content-Type on a CORS GET induces the failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>321455</commentid>
    <comment_count>5</comment_count>
    <who name="Sky Sanders">sky.sanders</who>
    <bug_when>2010-12-13 15:00:06 -0800</bug_when>
    <thetext>OOPS - Sorry, it is when GET content-type is set to application/json that the CORS GET fails.

Setting content-type to text/plain produces a successful CORS GET.

The problem with this, aside from the fact that the spec allows for content-type on a GET, is that the request content type is relevant to many json service implementations and omitting it requires, in most cases, modification to javascript frameworks and server side code, both of which I have had to implement to work around this issue.

please correct me if I have erred in my observations/conclusions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>321465</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-12-13 15:06:11 -0800</bug_when>
    <thetext>Can you provide a test URL for reproducing the problem? Or at least a test HTML page with a script that&apos;s sending the request?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>321489</commentid>
    <comment_count>7</comment_count>
    <who name="Sky Sanders">sky.sanders</who>
    <bug_when>2010-12-13 15:26:53 -0800</bug_when>
    <thetext>This demonstrates the bug.

        var xhr = new XMLHttpRequest();
        xhr.open(&quot;GET&quot;, &quot;http://manu.sporny.org/rdfa/cors&quot;, true);
        xhr.setRequestHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);
        xhr.onreadystatechange = function () {
            if (xhr.readyState == 4) {
                alert(&quot;Expected status: 200 responseText: SUCCESS ... \n got status&quot; + xhr.status + &quot;\nresponseText : &quot; + xhr.responseText);
            }
        }
        xhr.send();</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344611</commentid>
    <comment_count>8</comment_count>
    <who name="Martin Galpin">martin</who>
    <bug_when>2011-02-03 03:05:25 -0800</bug_when>
    <thetext>I can confirm this is still an issue on WebKit (and Chrome). Let me add some additional comments.

* The issue is not with a specific Content-Type (although it can be triggered by using a content-type not listed in CORS spec. [2.1])

* The problem is that in non-simple GET requests (those that require a preflight OPTIONS request), the Origin header is correctly sent with the OPTIONS but not the subsequent GET. Therefore, a server does not include the Access-Control-Allow-Origin in its response.

This has been previously reported in Chromium, see http://code.google.com/p/chromium/issues/detail?id=57836 and includes a matrix of requests.

What can we do to get this fixed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344769</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-03 09:27:12 -0800</bug_when>
    <thetext>&gt; What can we do to get this fixed?

The easiest way to get this bug fixes is to post a patch for review that fixes the issue and contains a test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345476</commentid>
    <comment_count>10</comment_count>
      <attachid>81216</attachid>
    <who name="Martin Galpin">martin</who>
    <bug_when>2011-02-04 07:18:03 -0800</bug_when>
    <thetext>Created attachment 81216
Proposed fix and regression test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345477</commentid>
    <comment_count>11</comment_count>
      <attachid>81216</attachid>
    <who name="Martin Galpin">martin</who>
    <bug_when>2011-02-04 07:20:26 -0800</bug_when>
    <thetext>Comment on attachment 81216
Proposed fix and regression test

I would suggest the problem is this:

Interest starts when a request reaches DocumentThreadableLoader
(see Source/WebCore/loaders/DocumentThreadableLoader.cpp).
 
After creating a new instance of ResourceRequest (for CORS) [line 87], 
it&apos;s checked if the request is &quot;simple&quot; or not (e.g. requires preflight).

If the request is simple (or preflight is forced), the following sequence 
takes place:

* DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest is called
  * The request origin is set [line 115]
* Request is submitted via DocumentThreadableLoader::loadRequest [line 311]

However, if the request is *not* simple, the following happens:

* DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight is called
  * A new OPTIONS request is created (and request origin set [line 125])
* Request is submitted via DocumentThreadableLoader::loadRequest [line 149]
* If the preflight succeeds, DocumentThreadableLoader::preflightSuccess() is
  called and the original request submitted [line 302]
...
(see Source/WebCore/loaders/FrameLoader.cpp)
* FrameLoader::addHTTPOriginIfNeeded [line 2680] is called for the CORS request
  and returns without setting the origin because it is not included by default
  on GET requests (for privacy concerns, see line 2690)
* Request later fails WebCore::passesAccessControlCheck at line 111
  (see Source/WebCore/loaders/CrossOriginAccessControl.cpp)

So the problem, therefore, is that whilst the origin header is explictly set
for a simple cross-origin GET request in (makeSimpleCrossOriginAccessRequest),
it is not explicitly after a preflight (and fails the implicit check in FrameLoader).

I attach a simple patch that fixes this by explictly setting the origin
when the cross-origin preflight is completed successfully. Also
included is a regression test for the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345614</commentid>
    <comment_count>12</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2011-02-04 10:54:14 -0800</bug_when>
    <thetext>Nicely done.

Now that I look at DocumentThreadableLoader with this header in mind, it looks like every time that loadRequest is called the origin should be set &quot;if (!m_sameOriginRequest)&quot;, but that introduces other wierdness.

At the very least, it should assert that the header is set &quot;if (!m_sameOriginRequest)&quot; However that requires a fix at line 76:
75	    if (m_sameOriginRequest || m_options.crossOriginRequestPolicy == AllowCrossOriginRequests) {
76	        loadRequest(request, DoSecurityCheck);

And a test which would involve worker import script which is a bit much to ask.

I filed bug 53790 about this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345619</commentid>
    <comment_count>13</comment_count>
      <attachid>81216</attachid>
    <who name="David Levin">levin</who>
    <bug_when>2011-02-04 11:00:20 -0800</bug_when>
    <thetext>Comment on attachment 81216
Proposed fix and regression test

View in context: https://bugs.webkit.org/attachment.cgi?id=81216&amp;action=review

This looks good to me. I just have a few minor suggestions to clean up and then we can get this committed.

&gt; Source/WebCore/ChangeLog:5
&gt; +        Bug 50773: CORS origin header not set on GET when a preflight request

Ideally this is formatted more like other ChangeLog entries:

Bug title
Bug link

(on separate lines).

&gt; Source/WebCore/loader/DocumentThreadableLoader.cpp:301
&gt; +    // Explicitly set the origin of this request

Add &quot;.&quot; to end of sentence.

&gt; LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-get.html:3
&gt; +&lt;p&gt;Test case for issue #50773 - the &quot;Origin&quot; header should be properly sent with a non-simple cross-origin resource sharing request that uses the GET method.&lt;/p&gt;

No need to mention the bug, so you can omit &quot;Test case for issue #50773 -&quot;

&gt; LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-get.html:20
&gt; +    xhr.setRequestHeader(&quot;X-Proprietary-Header&quot;, &quot;foo&quot;); // make this a non-simple CORS request

Please make the comment a proper sentence.

&quot;Make this a non-simple CORS request.&quot;

&gt; LayoutTests/http/tests/xmlhttprequest/resources/cross-origin-preflight-get.php:2
&gt; +// Test case for the preflight cross-origin request using GET (issue #50773)

You don&apos;t need to reference the bug number. If someone needs to find it, they can look at when the test was added and see the commit message, ChangeLog, etc. which will all reference the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345644</commentid>
    <comment_count>14</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-04 11:34:25 -0800</bug_when>
    <thetext>&gt; Add &quot;.&quot; to end of sentence.

Actually, I don&apos;t think that this comment adds any value as is. It should be removed, or it should explain what&apos;s so special about this code path that we need to set Origin manually.

What is the normal way to set Origin? Why don&apos;t we get it automatically added by FrameLoader::addHTTPOriginIfNeeded(), for example?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345645</commentid>
    <comment_count>15</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-04 11:35:46 -0800</bug_when>
    <thetext>&gt; You don&apos;t need to reference the bug number.

Personally, I like adding a link to the bug (not just mentioning the number). Not sure if that&apos;s useful in practice - I don&apos;t think I ever clicked on these links myself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345654</commentid>
    <comment_count>16</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-04 11:48:56 -0800</bug_when>
    <thetext>&gt; Why don&apos;t we get it automatically added by FrameLoader::addHTTPOriginIfNeeded(), for example?

That method does not understand CORS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345664</commentid>
    <comment_count>17</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-04 11:56:58 -0800</bug_when>
    <thetext>OK. We call setHTTPOrigin() without comments elsewhere in DocumentThreadableLoader, so this instance probably also doesn&apos;t need a comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345676</commentid>
    <comment_count>18</comment_count>
    <who name="Martin Galpin">martin</who>
    <bug_when>2011-02-04 12:09:22 -0800</bug_when>
    <thetext>Thanks for the comments. An amended patch will follow shortly.

&gt; Now that I look at DocumentThreadableLoader with this header in mind, it looks like every time that loadRequest is called the origin should be set &quot;if (!m_sameOriginRequest)&quot;, but that introduces other wierdness.

Yes, I found the same &quot;weirdness&quot;. This patch seems to be the least disruptive option in the short term.

&gt; Why don&apos;t we get it automatically added by FrameLoader::addHTTPOriginIfNeeded(), for example?

&gt; That method does not understand CORS.

Correct - FrameLoader::addHTTPOriginIfNeeded does not set &quot;Origin&quot; for a GET request (irrespective of whether it is CORS). Therefore we need to bring a preflighted request inline with a one which is simple [line 115].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345713</commentid>
    <comment_count>19</comment_count>
      <attachid>81272</attachid>
    <who name="Martin Galpin">martin</who>
    <bug_when>2011-02-04 12:50:17 -0800</bug_when>
    <thetext>Created attachment 81272
Proposed fix after feedback

This should [hopefully] address the previous comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345807</commentid>
    <comment_count>20</comment_count>
      <attachid>81272</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-04 14:42:12 -0800</bug_when>
    <thetext>Comment on attachment 81272
Proposed fix after feedback

Clearing flags on attachment: 81272

Committed r77680: &lt;http://trac.webkit.org/changeset/77680&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345808</commentid>
    <comment_count>21</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-04 14:42:16 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345830</commentid>
    <comment_count>22</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-04 15:00:56 -0800</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 81272:

http/tests/websocket/tests/handshake-fail-by-maxlength.html bug 53816
The commit-queue is continuing to process your patch.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>81216</attachid>
            <date>2011-02-04 07:18:03 -0800</date>
            <delta_ts>2011-02-04 11:00:19 -0800</delta_ts>
            <desc>Proposed fix and regression test</desc>
            <filename>50773.diff</filename>
            <type>text/plain</type>
            <size>4709</size>
            <attacher name="Martin Galpin">martin</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDc3NjI2KQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTEtMDItMDQgIE1hcnRpbiBH
YWxwaW4gIDxtYXJ0aW5ANjZsYXBzLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkg
KE9PUFMhKS4KKworICAgICAgICBCdWcgNTA3NzM6IENPUlMgb3JpZ2luIGhlYWRlciBub3Qgc2V0
IG9uIEdFVCB3aGVuIGEgcHJlZmxpZ2h0IHJlcXVlc3QKKyAgICAgICAgaXMgcmVxdWlyZWQuCisg
ICAgICAgIAorICAgICAgICBUZXN0OiBodHRwL3Rlc3RzL3htbGh0dHByZXF1ZXN0L2Nyb3NzLW9y
aWdpbi1wcmVmbGlnaHQtZ2V0Lmh0bWwKKworICAgICAgICAqIGxvYWRlci9Eb2N1bWVudFRocmVh
ZGFibGVMb2FkZXIuY3BwOgorICAgICAgICAoV2ViQ29yZTo6RG9jdW1lbnRUaHJlYWRhYmxlTG9h
ZGVyOjpwcmVmbGlnaHRTdWNjZXNzKTogCisgICAgICAgIEV4cGxpY2l0bHkgc2V0IHRoZSByZXF1
ZXN0IG9yaWdpbiBhZnRlciBhIHByZWZsaWdodCByZXF1ZXN0IHN1Y2NlZWRzLgorCiAyMDExLTAy
LTA0ICBQZXRlciBWYXJnYSAgPHB2YXJnYUB3ZWJraXQub3JnPgogCiAgICAgICAgIFJ1YmJlci1z
dG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XN0KCk7Cis8L3NjcmlwdD4KKzwvYm9k
eT4KKzwvaHRtbD4KSW5kZXg6IExheW91dFRlc3RzL2h0dHAvdGVzdHMveG1saHR0cHJlcXVlc3Qv
cmVzb3VyY2VzL2Nyb3NzLW9yaWdpbi1wcmVmbGlnaHQtZ2V0LnBocAo9PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBM
YXlvdXRUZXN0cy9odHRwL3Rlc3RzL3htbGh0dHByZXF1ZXN0L3Jlc291cmNlcy9jcm9zcy1vcmln
aW4tcHJlZmxpZ2h0LWdldC5waHAJKHJldmlzaW9uIDApCisrKyBMYXlvdXRUZXN0cy9odHRwL3Rl
c3RzL3htbGh0dHByZXF1ZXN0L3Jlc291cmNlcy9jcm9zcy1vcmlnaW4tcHJlZmxpZ2h0LWdldC5w
aHAJKHJldmlzaW9uIDApCkBAIC0wLDAgKzEsMTAgQEAKKzw/cGhwCisvLyBUZXN0IGNhc2UgZm9y
IHRoZSBwcmVmbGlnaHQgY3Jvc3Mtb3JpZ2luIHJlcXVlc3QgdXNpbmcgR0VUIChpc3N1ZSAjNTA3
NzMpCitpZighaXNzZXQoJF9TRVJWRVJbJ0hUVFBfT1JJR0lOJ10pKSB7CisgICAgZWNobyAiRkFJ
TDogTm8gb3JpZ2luIGhlYWRlciBzZW50IjsKK30gZWxzZSB7CisgICAgaGVhZGVyKCJBY2Nlc3Mt
Q29udHJvbC1BbGxvdy1PcmlnaW46ICoiKTsKKyAgICBoZWFkZXIoIkFjY2Vzcy1Db250cm9sLUFs
bG93LUhlYWRlcnM6IFgtUHJvcHJpZXRhcnktSGVhZGVyIik7CisgICAgZWNobyAiUEFTUzogT3Jp
Z2luIGhlYWRlciBjb3JyZWN0bHkgc2VudCI7Cit9Cis/Pgo=
</data>
<flag name="review"
          id="72772"
          type_id="1"
          status="-"
          setter="levin"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>81272</attachid>
            <date>2011-02-04 12:50:17 -0800</date>
            <delta_ts>2011-02-04 14:42:12 -0800</delta_ts>
            <desc>Proposed fix after feedback</desc>
            <filename>50773.diff</filename>
            <type>text/plain</type>
            <size>4566</size>
            <attacher name="Martin Galpin">martin</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDc3NjI2KQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTEtMDItMDQgIE1hcnRpbiBH
YWxwaW4gIDxtYXJ0aW5ANjZsYXBzLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkg
KE9PUFMhKS4KKworICAgICAgICBDT1JTIG9yaWdpbiBoZWFkZXIgbm90IHNldCBvbiBHRVQgd2hl
biBhIHByZWZsaWdodCByZXF1ZXN0IGlzIHJlcXVpcmVkLgorICAgICAgICBodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NTA3NzMKKyAgICAgICAgCisgICAgICAgIFRlc3Q6
IGh0dHAvdGVzdHMveG1saHR0cHJlcXVlc3QvY3Jvc3Mtb3JpZ2luLXByZWZsaWdodC1nZXQuaHRt
bAorCisgICAgICAgICogbG9hZGVyL0RvY3VtZW50VGhyZWFkYWJsZUxvYWRlci5jcHA6CisgICAg
ICAgIChXZWJDb3JlOjpEb2N1bWVudFRocmVhZGFibGVMb2FkZXI6OnByZWZsaWdodFN1Y2Nlc3Mp
OiAKKyAgICAgICAgRXhwbGljaXRseSBzZXQgdGhlIHJlcXVlc3Qgb3JpZ2luIGFm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KK3Rlc3QoKTsKKzwvc2NyaXB0PgorPC9ib2R5PgorPC9o
dG1sPgpJbmRleDogTGF5b3V0VGVzdHMvaHR0cC90ZXN0cy94bWxodHRwcmVxdWVzdC9yZXNvdXJj
ZXMvY3Jvc3Mtb3JpZ2luLXByZWZsaWdodC1nZXQucGhwCj09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIExheW91dFRl
c3RzL2h0dHAvdGVzdHMveG1saHR0cHJlcXVlc3QvcmVzb3VyY2VzL2Nyb3NzLW9yaWdpbi1wcmVm
bGlnaHQtZ2V0LnBocAkocmV2aXNpb24gMCkKKysrIExheW91dFRlc3RzL2h0dHAvdGVzdHMveG1s
aHR0cHJlcXVlc3QvcmVzb3VyY2VzL2Nyb3NzLW9yaWdpbi1wcmVmbGlnaHQtZ2V0LnBocAkocmV2
aXNpb24gMCkKQEAgLTAsMCArMSw5IEBACis8P3BocAoraWYoIWlzc2V0KCRfU0VSVkVSWydIVFRQ
X09SSUdJTiddKSkgeworICAgIGVjaG8gIkZBSUw6IE5vIG9yaWdpbiBoZWFkZXIgc2VudCI7Cit9
IGVsc2UgeworICAgIGhlYWRlcigiQWNjZXNzLUNvbnRyb2wtQWxsb3ctT3JpZ2luOiAqIik7Cisg
ICAgaGVhZGVyKCJBY2Nlc3MtQ29udHJvbC1BbGxvdy1IZWFkZXJzOiBYLVByb3ByaWV0YXJ5LUhl
YWRlciIpOworICAgIGVjaG8gIlBBU1M6IE9yaWdpbiBoZWFkZXIgY29ycmVjdGx5IHNlbnQiOwor
fQorPz4K
</data>

          </attachment>
      

    </bug>

</bugzilla>