c# - Server Sent Events with CORS support -
I am using and allow me to use it over the root.
I have set up ServiceStack CorsFeature
in my application, but it is not honored by ServerEventsFeature
.
I can manually add the app-control-permission-origin
heading to added
, and request that the event- Stream
, but the request for heartbeat fails because I can not set the header on this request.
plugins.ed (new server eventfeature {heartbeat interface = new timepace (0,0,30) on crated = (subscription, request) => ; SSE functionality as I request.Response.AddHeader ("Access-control-permission-origin", "*");} ...}
, I can not see that How to get this header in the request. Is there a way that I can set the header for all / event -
url?
Thanks. / P> < / Div>
Only / event-stream
and / event-heartbeat
are raw HTTP handlers, other events - *
route common service stacks The service stack requests are through the pipeline.
I have automatically created the Config.GlobalResponseHeaders
/ Event-Stream
and / Event-Heartbeat <
This change will now automatically add to the / code> handler.
I OnBarbit
for / event-heartbeat
mailback match / event-stream Od has
OnInit
callback so you can add custom headers heartbeat handler.
Plugins.Add (New Server Event Feature {Heartbeat Interval = New Timespace (0, 0, 30), OnInit = (Request) => (request.Response.AddHeader (...) ;}, OnHeartbeatInit = (requested) => {request.Response.AddHeader (...);}, ...}
This change is now made to v4.0.34 + .
Comments
Post a Comment