Bug 206064 - EventSource Http Status: 200 but Showing Error
Summary: EventSource Http Status: 200 but Showing Error
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: Safari 13
Hardware: Mac macOS 10.15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-10 05:56 PST by Dhruvesh Parikh
Modified: 2020-01-10 13:55 PST (History)
3 users (show)

See Also:


Attachments
safari eventsource with close (796.54 KB, image/jpeg)
2020-01-10 05:56 PST, Dhruvesh Parikh
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dhruvesh Parikh 2020-01-10 05:56:41 PST
Created attachment 387331 [details]
safari eventsource with close

When using EventSource (https://developer.mozilla.org/en-US/docs/Web/API/EventSource) library in Safari 13, with closing the connection when done,
Ex: 
var source = new window.EventSource("someurl");
source.onmessage = function(event) {
    source.close();
};


I am getting error in WebInspector inspite the status code is 200. Means behaviour is as intended, only showing error in WebInspector UI.
I have explained in image the same.

Image: bug-safari-eventsource-close.jpeg

When we are not closing the EventSource object it works fine
#source.close() 

Can we solve this ?

Link: https://jsfiddle.net/parikhdhruvesh1/kxos7yjz/24/
Comment 1 Radar WebKit Bug Importer 2020-01-10 13:55:32 PST
<rdar://problem/58489814>