2011-04-07 Julien Chaffraix <jchaffraix@codeaurora.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2011 06:45:30 +0000 (06:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2011 06:45:30 +0000 (06:45 +0000)
commit94704023889553e2aad57069971394c4b7d6913b
tree966be33d6f6be92aec5675399c9c786a44a21a88
parentdc13c9d6ad80e5cab6a379098383d9da51ba8a1e
2011-04-07  Julien Chaffraix  <jchaffraix@codeaurora.org>

        Reviewed by Alexey Proskuryakov.

        EventSource should only accept UTF-8 charset
        https://bugs.webkit.org/show_bug.cgi?id=56942

        * ChangeLog-2011-02-16: Corrected previous commit message. Pointed out by Alexey.

        * http/tests/eventsource/eventsource-bad-mime-type-expected.txt: Updated with the new console message.

        * http/tests/eventsource/eventsource-content-type-charset-expected.txt:
        * http/tests/eventsource/eventsource-content-type-charset.html: Beefed up this test and merged
        the following test into it. The new tests check that we dispatch a console error if the charset is
        wrong.

        * http/tests/eventsource/eventsource-content-type-text-event-stream-foobar-expected.txt: Removed.
        * http/tests/eventsource/eventsource-content-type-text-event-stream-foobar.html: Removed.

        * http/tests/eventsource/resources/response-content-type-charset.php: Return the charset passed
        in the URL. Also added PHP's magic quotes handling as this would make the test fail on Mac.

        * http/tests/eventsource/resources/response-content-type-event-stream-foobar.php: Removed.
2011-04-07  Julien Chaffraix  <jchaffraix@codeaurora.org>

        Reviewed by Alexey Proskuryakov.

        EventSource should only accept UTF-8 charset
        https://bugs.webkit.org/show_bug.cgi?id=56942

        Following the discussion on bug 45372, this change implements the recommended
        way of handling "charset". We only accept UTF-8 but no other encoding. This matches
        the encoding of the EventSource and also may fix TomCat that automatically send this
        charset.

        * page/EventSource.cpp:
        (WebCore::EventSource::didReceiveResponse): We now check the charset attribute and if it is
        not UTF-8, abort the connection and log the error to the console. Also we log if the MIME type
        is wrong to the console to help debugging (only in the case of an HTTP 200 response though).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/ChangeLog-2011-02-16
LayoutTests/http/tests/eventsource/eventsource-bad-mime-type-expected.txt
LayoutTests/http/tests/eventsource/eventsource-content-type-charset-expected.txt
LayoutTests/http/tests/eventsource/eventsource-content-type-charset.html
LayoutTests/http/tests/eventsource/eventsource-content-type-text-event-stream-foobar-expected.txt [deleted file]
LayoutTests/http/tests/eventsource/eventsource-content-type-text-event-stream-foobar.html [deleted file]
LayoutTests/http/tests/eventsource/resources/response-content-type-charset.php
LayoutTests/http/tests/eventsource/resources/response-content-type-event-stream-foobar.php [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/page/EventSource.cpp