mirror of
https://github.com/livekit/livekit.git
synced 2026-04-04 16:55:45 +00:00
/rtc responds to only websocket requests. Fixes #25
This commit is contained in:
@@ -48,6 +48,12 @@ func NewRTCService(conf *config.Config, roomStore RoomStore, roomManager *RoomMa
|
||||
}
|
||||
|
||||
func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// reject non websocket requests
|
||||
if !websocket.IsWebSocketUpgrade(r) {
|
||||
w.WriteHeader(404)
|
||||
return
|
||||
}
|
||||
|
||||
roomName := r.FormValue("room")
|
||||
reconnectParam := r.FormValue("reconnect")
|
||||
isReconnect := reconnectParam == "1" || reconnectParam == "true"
|
||||
|
||||
Reference in New Issue
Block a user