@@ -138,7 +138,7 @@ public function listActiveRooms($appId, $prefix = null, $offset = null, $limit =
138138 if (isset ($ limit )) {
139139 $ query ['limit ' ] = $ limit ;
140140 }
141- if ($ query != null ) {
141+ if (isset ( $ query) && ! empty ( $ query ) ) {
142142 $ query = '? ' . http_build_query ($ query );
143143 $ url = sprintf ("%s/%s/rooms%s " , $ this ->baseURL , $ appId , $ query );
144144 } else {
@@ -170,7 +170,7 @@ public function appToken($appId, $roomName, $userId, $expireAt, $permission)
170170
171171 private function get ($ url , $ cType = null )
172172 {
173- $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "GET " , $ body , $ cType );
173+ $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "GET " , null , $ cType );
174174 $ rtcToken ['Content-Type ' ] = $ cType ;
175175 $ ret = Client::get ($ url , $ rtcToken );
176176 if (!$ ret ->ok ()) {
@@ -179,21 +179,21 @@ private function get($url, $cType = null)
179179 return array ($ ret ->json (), null );
180180 }
181181
182- private function delete ($ url , $ cType = 'application/json ' )
182+ private function delete ($ url , $ contentType = 'application/json ' )
183183 {
184- $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "DELETE " , $ body , $ cType );
185- $ rtcToken ['Content-Type ' ] = $ cType ;
184+ $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "DELETE " , null , $ contentType );
185+ $ rtcToken ['Content-Type ' ] = $ contentType ;
186186 $ ret = Client::delete ($ url , $ rtcToken );
187187 if (!$ ret ->ok ()) {
188188 return array (null , new Error ($ url , $ ret ));
189189 }
190190 return array ($ ret ->json (), null );
191191 }
192192
193- private function post ($ url , $ body , $ cType = 'application/json ' )
193+ private function post ($ url , $ body , $ contentType = 'application/json ' )
194194 {
195- $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "POST " , $ body , $ cType );
196- $ rtcToken ['Content-Type ' ] = $ cType ;
195+ $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "POST " , $ body , $ contentType );
196+ $ rtcToken ['Content-Type ' ] = $ contentType ;
197197 $ ret = Client::post ($ url , $ body , $ rtcToken );
198198 if (!$ ret ->ok ()) {
199199 return array (null , new Error ($ url , $ ret ));
0 commit comments