Changeset 220799 in webkit


Ignore:
Timestamp:
Aug 16, 2017 10:30:39 AM (7 years ago)
Author:
Chris Dumez
Message:

EventSource: ignore IDs with U+0000
https://bugs.webkit.org/show_bug.cgi?id=175178

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import WPT test coverage from:

  • web-platform-tests/eventsource/format-field-id-null-expected.txt: Added.
  • web-platform-tests/eventsource/format-field-id-null.htm: Added.
  • web-platform-tests/eventsource/resources/last-event-id.py:

(main):

  • web-platform-tests/eventsource/w3c-import.log:

Source/WebCore:

EventSource: ignore IDs with U+0000 as per:
https://github.com/whatwg/html/pull/2849

Test: imported/w3c/web-platform-tests/eventsource/format-field-id-null.htm

  • page/EventSource.cpp:

(WebCore::EventSource::parseEventStreamLine):

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r220785 r220799  
     12017-08-16  Chris Dumez  <cdumez@apple.com>
     2
     3        EventSource: ignore IDs with U+0000
     4        https://bugs.webkit.org/show_bug.cgi?id=175178
     5
     6        Reviewed by Darin Adler.
     7
     8        Import WPT test coverage from:
     9        - https://github.com/w3c/web-platform-tests/pull/6584
     10
     11        * web-platform-tests/eventsource/format-field-id-null-expected.txt: Added.
     12        * web-platform-tests/eventsource/format-field-id-null.htm: Added.
     13        * web-platform-tests/eventsource/resources/last-event-id.py:
     14        (main):
     15        * web-platform-tests/eventsource/w3c-import.log:
     16
    1172017-08-15  Andy Estes  <aestes@apple.com>
    218
  • trunk/LayoutTests/imported/w3c/web-platform-tests/eventsource/resources/last-event-id.py

    r220733 r220799  
    44  response.headers.set("Content-Type", "text/event-stream")
    55  last_event_id = request.headers.get('Last-Event-ID', None)
     6  value = request.GET.first("idvalue", "…")
    67
    78  if(last_event_id):
    89      return "data: " + last_event_id + "\n\n"
    910  else:
    10     return "id: \nretry: 200\ndata: hello\n\n"
     11    return "id: " + value + "\nretry: 200\ndata: hello\n\n"
    1112
  • trunk/LayoutTests/imported/w3c/web-platform-tests/eventsource/w3c-import.log

    r220733 r220799  
    4343/LayoutTests/imported/w3c/web-platform-tests/eventsource/format-field-event.htm
    4444/LayoutTests/imported/w3c/web-platform-tests/eventsource/format-field-id-2.htm
     45/LayoutTests/imported/w3c/web-platform-tests/eventsource/format-field-id-null.htm
    4546/LayoutTests/imported/w3c/web-platform-tests/eventsource/format-field-id.htm
    4647/LayoutTests/imported/w3c/web-platform-tests/eventsource/format-field-parsing.htm
  • trunk/Source/WebCore/ChangeLog

    r220797 r220799  
     12017-08-16  Chris Dumez  <cdumez@apple.com>
     2
     3        EventSource: ignore IDs with U+0000
     4        https://bugs.webkit.org/show_bug.cgi?id=175178
     5
     6        Reviewed by Darin Adler.
     7
     8        EventSource: ignore IDs with U+0000 as per:
     9        https://github.com/whatwg/html/pull/2849
     10
     11        Test: imported/w3c/web-platform-tests/eventsource/format-field-id-null.htm
     12
     13        * page/EventSource.cpp:
     14        (WebCore::EventSource::parseEventStreamLine):
     15
    1162017-08-16  Fujii Hironori  <Hironori.Fujii@sony.com>
    217
  • trunk/Source/WebCore/page/EventSource.cpp

    r219856 r220799  
    346346    } else if (field == "event")
    347347        m_eventName = { &m_receiveBuffer[position], valueLength };
    348     else if (field == "id")
    349         m_currentlyParsedEventId = { &m_receiveBuffer[position], valueLength };
    350     else if (field == "retry") {
     348    else if (field == "id") {
     349        StringView parsedEventId = { &m_receiveBuffer[position], valueLength };
     350        if (!parsedEventId.contains('\0'))
     351            m_currentlyParsedEventId = parsedEventId.toString();
     352    } else if (field == "retry") {
    351353        if (!valueLength)
    352354            m_reconnectDelay = defaultReconnectDelay;
Note: See TracChangeset for help on using the changeset viewer.