Changeset 74011 in webkit


Ignore:
Timestamp:
Dec 14, 2010 3:29:43 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-12-14 Julien Chaffraix <jchaffraix@codeaurora.org>

Reviewed by Darin Adler.

Test for: EventSource fails to connect if Content-Type header has a charset attribute
https://bugs.webkit.org/show_bug.cgi?id=45372

Test that a Content-Type of "text/event-stream; charset=UTF8" works correctly but
"text/event-stream" does not work.

  • http/tests/eventsource/eventsource-content-type-charset-expected.txt: Added.
  • http/tests/eventsource/eventsource-content-type-charset.html: Added.
  • http/tests/eventsource/eventsource-content-type-text-event-stream-foobar-expected.txt: Added.
  • http/tests/eventsource/eventsource-content-type-text-event-stream-foobar.html: Added.
  • http/tests/eventsource/resources/response-content-type-charset.php: Added.
  • http/tests/eventsource/resources/response-content-type-event-stream-foobar.php: Added.

2010-12-14 Julien Chaffraix <jchaffraix@codeaurora.org>

Reviewed by Darin Adler.

Test for: EventSource fails to connect if Content-Type header has a charset attribute
https://bugs.webkit.org/show_bug.cgi?id=45372

Tests: http/tests/eventsource/eventsource-content-type-charset.html

http/tests/eventsource/eventsource-content-type-text-event-stream-foobar.html

  • page/EventSource.cpp: (WebCore::EventSource::didReceiveResponse): Use the mimeType instead of the Content-Type header directly. This makes the detection of the "text/stream" mimeType more accurate.
Location:
trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r74010 r74011  
     12010-12-14  Julien Chaffraix  <jchaffraix@codeaurora.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Test for: EventSource fails to connect if Content-Type header has a charset attribute
     6        https://bugs.webkit.org/show_bug.cgi?id=45372
     7
     8        Test that a Content-Type of "text/event-stream; charset=UTF8" works correctly but
     9        "text/event-stream" does not work.
     10
     11        * http/tests/eventsource/eventsource-content-type-charset-expected.txt: Added.
     12        * http/tests/eventsource/eventsource-content-type-charset.html: Added.
     13        * http/tests/eventsource/eventsource-content-type-text-event-stream-foobar-expected.txt: Added.
     14        * http/tests/eventsource/eventsource-content-type-text-event-stream-foobar.html: Added.
     15        * http/tests/eventsource/resources/response-content-type-charset.php: Added.
     16        * http/tests/eventsource/resources/response-content-type-event-stream-foobar.php: Added.
     17
    1182010-12-14  Pieter Senster  <psenster@google.com>
    219
  • trunk/WebCore/ChangeLog

    r74010 r74011  
     12010-12-14  Julien Chaffraix  <jchaffraix@codeaurora.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Test for: EventSource fails to connect if Content-Type header has a charset attribute
     6        https://bugs.webkit.org/show_bug.cgi?id=45372
     7
     8        Tests: http/tests/eventsource/eventsource-content-type-charset.html
     9               http/tests/eventsource/eventsource-content-type-text-event-stream-foobar.html
     10
     11        * page/EventSource.cpp:
     12        (WebCore::EventSource::didReceiveResponse): Use the mimeType instead of the Content-Type
     13        header directly. This makes the detection of the "text/stream" mimeType more accurate.
     14
    1152010-12-14  Pieter Senster  <psenster@google.com>
    216
  • trunk/WebCore/page/EventSource.cpp

    r72625 r74011  
    181181{
    182182    int statusCode = response.httpStatusCode();
    183     if (statusCode == 200 && response.httpHeaderField("Content-Type") == "text/event-stream") {
     183    if (statusCode == 200 && response.mimeType() == "text/event-stream") {
    184184        m_state = OPEN;
    185185        dispatchEvent(Event::create(eventNames().openEvent, false, false));
Note: See TracChangeset for help on using the changeset viewer.