Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[EventSource] Stop allowing trailing junk when parsing retry delay
https://bugs.webkit.org/show_bug.cgi?id=243227 Reviewed by Darin Adler. Stop allowing trailing junk when parsing retry delay for EventSource: - https://html.spec.whatwg.org/multipage/server-sent-events.html#processField This aligns our behavior with Blink and Gecko. * LayoutTests/imported/w3c/web-platform-tests/eventsource/format-field-retry-bogus.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/eventsource/format-field-retry-bogus.any.worker-expected.txt: * Source/WebCore/page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): Canonical link: https://commits.webkit.org/252885@main
- Loading branch information
Showing
8 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...s/imported/w3c/web-platform-tests/eventsource/format-field-retry-bogus-2.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS EventSource: "retry" field (bogus) | ||
|
1 change: 1 addition & 0 deletions
1
LayoutTests/imported/w3c/web-platform-tests/eventsource/format-field-retry-bogus-2.any.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- This file is required for WebKit test infrastructure to run the templated test --> |
19 changes: 19 additions & 0 deletions
19
LayoutTests/imported/w3c/web-platform-tests/eventsource/format-field-retry-bogus-2.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// META: title=EventSource: "retry" field (bogus) | ||
var test = async_test() | ||
test.step(function() { | ||
var timeoutms = 1000, | ||
source = new EventSource("resources/message.py?message=retry%3A1000%0Aretry%3A5000x%0Adata%3Ax"), | ||
opened = 0 | ||
source.onopen = function() { | ||
test.step(function() { | ||
if(opened == 0) { | ||
opened = new Date().getTime() | ||
} else { | ||
var diff = (new Date().getTime()) - opened | ||
assert_true(Math.abs(1 - diff / timeoutms) < 0.25) // allow 25% difference | ||
this.close(); | ||
test.done() | ||
} | ||
}, this) | ||
} | ||
}) |
3 changes: 3 additions & 0 deletions
3
...ted/w3c/web-platform-tests/eventsource/format-field-retry-bogus-2.any.worker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS EventSource: "retry" field (bogus) | ||
|
1 change: 1 addition & 0 deletions
1
...ts/imported/w3c/web-platform-tests/eventsource/format-field-retry-bogus-2.any.worker.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- This file is required for WebKit test infrastructure to run the templated test --> |
2 changes: 1 addition & 1 deletion
2
...sts/imported/w3c/web-platform-tests/eventsource/format-field-retry-bogus.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL EventSource: "retry" field (bogus) assert_true: expected true got false | ||
PASS EventSource: "retry" field (bogus) | ||
|
2 changes: 1 addition & 1 deletion
2
...orted/w3c/web-platform-tests/eventsource/format-field-retry-bogus.any.worker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL EventSource: "retry" field (bogus) assert_true: expected true got false | ||
PASS EventSource: "retry" field (bogus) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters