Do not require create permission for WHIP participant. (#3715)
This commit is contained in:
@@ -91,7 +91,6 @@ func (s *RTCRestService) handleGet(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *RTCRestService) handleOptions(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-Origin", "*")
|
||||||
w.Header().Set("Access-Control-Allow-Headers", "*")
|
w.Header().Set("Access-Control-Allow-Headers", "*")
|
||||||
w.Header().Set("Access-Control-Allow-Methods", "PATCH, OPTIONS, GET, POST, DELETE")
|
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
|
return nil, http.StatusUnauthorized, rtc.ErrPermissionDenied
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := EnsureCreatePermission(r.Context()); err != nil {
|
|
||||||
return nil, http.StatusUnauthorized, err
|
|
||||||
}
|
|
||||||
|
|
||||||
roomName, err := EnsureJoinPermission(r.Context())
|
roomName, err := EnsureJoinPermission(r.Context())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, http.StatusUnauthorized, err
|
return nil, http.StatusUnauthorized, err
|
||||||
@@ -161,6 +156,9 @@ func (s *RTCRestService) validateCreate(r *http.Request) (*createRequest, int, e
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, http.StatusBadRequest, fmt.Errorf("body does not have SDP offer: %s", err)
|
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)
|
offerSDP := string(offerSDPBytes)
|
||||||
sd := &webrtc.SessionDescription{
|
sd := &webrtc.SessionDescription{
|
||||||
Type: webrtc.SDPTypeOffer,
|
Type: webrtc.SDPTypeOffer,
|
||||||
|
|||||||
Reference in New Issue
Block a user