terraform deploy on ECS (#27)
This commit is contained in:
@@ -55,6 +55,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// require a claim
|
||||
if claims == nil || claims.Video == nil {
|
||||
handleError(w, http.StatusUnauthorized, rtc.ErrPermissionDenied.Error())
|
||||
return
|
||||
}
|
||||
identity := claims.Identity
|
||||
|
||||
@@ -170,22 +171,3 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type errStruct struct {
|
||||
StatusCode int `json:"statusCode"`
|
||||
Error string `json:"error"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func jsonError(code int, error ...string) errStruct {
|
||||
es := errStruct{
|
||||
StatusCode: code,
|
||||
}
|
||||
if len(error) > 0 {
|
||||
es.Error = error[0]
|
||||
}
|
||||
if len(error) > 1 {
|
||||
es.Message = error[1]
|
||||
}
|
||||
return es
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user