[Webkit-unassigned] [Bug 56942] EventSource should accept UTF-8 charset

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 23 14:05:53 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=56942





--- Comment #4 from Julien Chaffraix <jchaffraix at webkit.org>  2011-03-23 14:05:53 PST ---
> Does charset="UTF-8" (with quotes) work? Could you add a test?

It does, I will add some testing along those lines.

> Pelase do send a message to HTML mailing list, as suggested by Ian.

Sure. Ian, we are actually already allowing a charset in the Content-Type header.

> > LayoutTests/http/tests/eventsource/eventsource-content-type-charset-expected.txt:1
> > +CONSOLE MESSAGE: line 1: EventSource's response had a charset ("Windows-1152") that is not UTF-8. Aborting the connection.
> 
> There are two failure subtests, so why only one console message?

There is 2 failures but only one failure involves an invalid charset. We only log the error when we have a valid mime-type but an invalid charset thus only one console message. Would like me to log also if the mime-type is wrong?

> > Source/WebCore/page/EventSource.cpp:186
> > -    if (statusCode == 200 && response.mimeType() == "text/event-stream") {
> > +    bool isResponseValid = statusCode == 200 && response.mimeType() == "text/event-stream";
> 
> I'm confused. The bug description sounds like we should be allowing more than we do today, but the actual fix makes code more restrictive. Which is correct?

This is correct. This change is restricting the behavior to only accept UTF-8 as was suggested in the previous bug.

> Also, s/isResponseValid/responseIsValid/ (or isValidResponse).

OK.

> > Source/WebCore/page/EventSource.cpp:194
> > +            String message = "EventSource's response had a charset (\"";
> > +            message += charset;
> > +            message += "\") that is not UTF-8. Aborting the connection.";
> 
> I think it's wrong grammar to have different tenses in one sentence (had... is).

I will fix it to use present in both cases.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list