diff --git a/README.md b/README.md index cee27c97..6aa9a902 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu * [Hongchao Ma(马洪超)](https://github.com/hcm007) * [Aaron France](https://github.com/AeroNotix) * [Chris Hiszpanski](https://github.com/thinkski) - *Fix Answer bundle generation* +* [Vicken Simonian](https://github.com/vsimon) ### License MIT License - see [LICENSE](LICENSE) for full text diff --git a/errors.go b/errors.go index d1b4821d..f97d26b6 100644 --- a/errors.go +++ b/errors.go @@ -19,13 +19,13 @@ var ( // ErrCertificateExpired indicates that an x509 certificate has expired. ErrCertificateExpired = errors.New("x509Cert expired") - // ErrNoTurnCredencials indicates that a TURN server URL was provided + // ErrNoTurnCredentials indicates that a TURN server URL was provided // without required credentials. - ErrNoTurnCredencials = errors.New("turn server credentials required") + ErrNoTurnCredentials = errors.New("turn server credentials required") - // ErrTurnCredencials indicates that provided TURN credentials are partial + // ErrTurnCredentials indicates that provided TURN credentials are partial // or malformed. - ErrTurnCredencials = errors.New("invalid turn server credentials") + ErrTurnCredentials = errors.New("invalid turn server credentials") // ErrExistingTrack indicates that a track already exists. ErrExistingTrack = errors.New("track already exists") diff --git a/iceserver.go b/iceserver.go index e9f3b5ae..2387259b 100644 --- a/iceserver.go +++ b/iceserver.go @@ -37,7 +37,7 @@ func (s ICEServer) urls() ([]*ice.URL, error) { if url.Scheme == ice.SchemeTypeTURN || url.Scheme == ice.SchemeTypeTURNS { // https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.2) if s.Username == "" || s.Credential == nil { - return nil, &rtcerr.InvalidAccessError{Err: ErrNoTurnCredencials} + return nil, &rtcerr.InvalidAccessError{Err: ErrNoTurnCredentials} } url.Username = s.Username @@ -46,18 +46,18 @@ func (s ICEServer) urls() ([]*ice.URL, error) { // https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.3) password, ok := s.Credential.(string) if !ok { - return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredencials} + return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredentials} } url.Password = password case ICECredentialTypeOauth: // https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.4) if _, ok := s.Credential.(OAuthCredential); !ok { - return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredencials} + return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredentials} } default: - return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredencials} + return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredentials} } } diff --git a/iceserver_js.go b/iceserver_js.go index 227014ac..7ccfd89a 100644 --- a/iceserver_js.go +++ b/iceserver_js.go @@ -34,24 +34,24 @@ func (s ICEServer) validate() ([]*ice.URL, error) { if url.Scheme == ice.SchemeTypeTURN || url.Scheme == ice.SchemeTypeTURNS { // // https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.2) // if s.Username == "" || s.Credential == nil { - // return nil, &rtcerr.InvalidAccessError{Err: ErrNoTurnCredencials} + // return nil, &rtcerr.InvalidAccessError{Err: ErrNoTurnCredentials} // } // switch s.CredentialType { // case ICECredentialTypePassword: // // https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.3) // if _, ok := s.Credential.(string); !ok { - // return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredencials} + // return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredentials} // } // case ICECredentialTypeOauth: // // https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.4) // if _, ok := s.Credential.(OAuthCredential); !ok { - // return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredencials} + // return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredentials} // } // default: - // return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredencials} + // return nil, &rtcerr.InvalidAccessError{Err: ErrTurnCredentials} // } return nil, errors.New("TURN is not currently supported in the JavaScript/Wasm bindings") } diff --git a/iceserver_test.go b/iceserver_test.go index cd819c3c..70b28ce8 100644 --- a/iceserver_test.go +++ b/iceserver_test.go @@ -45,25 +45,25 @@ func TestICEServer_validate(t *testing.T) { }{ {ICEServer{ URLs: []string{"turn:192.158.29.39?transport=udp"}, - }, &rtcerr.InvalidAccessError{Err: ErrNoTurnCredencials}}, + }, &rtcerr.InvalidAccessError{Err: ErrNoTurnCredentials}}, {ICEServer{ URLs: []string{"turn:192.158.29.39?transport=udp"}, Username: "unittest", Credential: false, CredentialType: ICECredentialTypePassword, - }, &rtcerr.InvalidAccessError{Err: ErrTurnCredencials}}, + }, &rtcerr.InvalidAccessError{Err: ErrTurnCredentials}}, {ICEServer{ URLs: []string{"turn:192.158.29.39?transport=udp"}, Username: "unittest", Credential: false, CredentialType: ICECredentialTypeOauth, - }, &rtcerr.InvalidAccessError{Err: ErrTurnCredencials}}, + }, &rtcerr.InvalidAccessError{Err: ErrTurnCredentials}}, {ICEServer{ URLs: []string{"turn:192.158.29.39?transport=udp"}, Username: "unittest", Credential: false, CredentialType: Unknown, - }, &rtcerr.InvalidAccessError{Err: ErrTurnCredencials}}, + }, &rtcerr.InvalidAccessError{Err: ErrTurnCredentials}}, {ICEServer{ URLs: []string{"stun:google.de?transport=udp"}, Username: "unittest", diff --git a/peerconnection_go_test.go b/peerconnection_go_test.go index 15809330..d15a8c0d 100644 --- a/peerconnection_go_test.go +++ b/peerconnection_go_test.go @@ -104,7 +104,7 @@ func TestNew_Go(t *testing.T) { }, }, }) - }, &rtcerr.InvalidAccessError{Err: ErrNoTurnCredencials}}, + }, &rtcerr.InvalidAccessError{Err: ErrNoTurnCredentials}}, } for i, testCase := range testCases { @@ -220,7 +220,7 @@ func TestPeerConnection_SetConfiguration_Go(t *testing.T) { }, }, }, - wantErr: &rtcerr.InvalidAccessError{Err: ErrNoTurnCredencials}, + wantErr: &rtcerr.InvalidAccessError{Err: ErrNoTurnCredentials}, }, } { pc, err := test.init()