mirror right at the ping
authorMichael Wallner <mike@php.net>
Wed, 12 Aug 2015 18:31:22 +0000 (20:31 +0200)
committerMichael Wallner <mike@php.net>
Wed, 12 Aug 2015 18:31:22 +0000 (20:31 +0200)
public/mirror.php

index 57970db17d73da21aedc18e732d98717713ec00d..27f3c61697454b87c354aea9db7ba90e7b96423f 100644 (file)
@@ -37,15 +37,12 @@ switch ($evt) {
                $response->getBody()->append("Not a configured event");
                break;
        case "ping";
-               $response->setResponseCode(204);
-               $response->setResponseStatus("PONG");
-               break;
        case "push":
                if (!($json = json_decode($request->getBody()))) {
                        $response->setResponseCode(415);
                        $response->setContentType($request->getHeader("Content-Type"));
                        $response->getBody()->append($request->getBody());
-               } elseif (!in_array($json->repository->owner->name, $owners, true)) {
+               } elseif (!in_array(isset($json->repository->owner->name)?$json->repository->owner->name:$json->repository->owner->login, $owners, true)) {
                        $response->setResponseCode(403);
                        $response->getBody()->append("Invalid owner");
                } else {