HTTP Authorization Header in EventSource (Server Sent Events)

前端 未结 8 2098
梦谈多话
梦谈多话 2021-02-01 01:52

I need to set an Authorization header to an HTML5 EventSource. As Server Sent Events seems to be disused since Websockets appeared, I cannot find any useful documentation. The a

8条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-01 02:10

    the other way to pass auth token is through the URL as query param, but you should take security in consideration. Also add support of authorization through query param on the sever side.

提交回复
热议问题