diff --git a/pkg/service/rtcrestservice.go b/pkg/service/rtcrestservice.go index e993b96f..10b53620 100644 --- a/pkg/service/rtcrestservice.go +++ b/pkg/service/rtcrestservice.go @@ -91,7 +91,6 @@ func (s *RTCRestService) handleGet(w http.ResponseWriter, r *http.Request) { } func (s *RTCRestService) handleOptions(w http.ResponseWriter, r *http.Request) { - logger.Infow("RAJA got here to options", "req", r) // REMOVE w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Headers", "*") w.Header().Set("Access-Control-Allow-Methods", "PATCH, OPTIONS, GET, POST, DELETE") @@ -124,10 +123,6 @@ func (s *RTCRestService) validateCreate(r *http.Request) (*createRequest, int, e return nil, http.StatusUnauthorized, rtc.ErrPermissionDenied } - if err := EnsureCreatePermission(r.Context()); err != nil { - return nil, http.StatusUnauthorized, err - } - roomName, err := EnsureJoinPermission(r.Context()) if err != nil { return nil, http.StatusUnauthorized, err @@ -161,6 +156,9 @@ func (s *RTCRestService) validateCreate(r *http.Request) (*createRequest, int, e if err != nil { return nil, http.StatusBadRequest, fmt.Errorf("body does not have SDP offer: %s", err) } + if len(offerSDPBytes) == 0 { + return nil, http.StatusBadRequest, errors.New("body does not have SDP offer") + } offerSDP := string(offerSDPBytes) sd := &webrtc.SessionDescription{ Type: webrtc.SDPTypeOffer,