Procházet zdrojové kódy

Merge pull request #317 from ushios/bitbucket

Support Bitbucket git protocol
Jordi Boggiano před 11 roky
rodič
revize
cd95a43de2

+ 1 - 1
src/Packagist/WebBundle/Controller/ApiController.php

@@ -111,7 +111,7 @@ class ApiController extends Controller
             return new Response(json_encode(array('status' => 'error', 'message' => 'Missing or invalid payload',)), 406);
         }
 
-        $urlRegex = '{^(?:https?://)?(?P<host>bitbucket\.org)/(?P<path>[\w.-]+/[\w.-]+?)(\.git)?/?$}';
+        $urlRegex = '{^(?:https?://|git://|git@)?(?P<host>bitbucket\.org)[/:](?P<path>[\w.-]+/[\w.-]+?)(\.git)?/?$}';
         $repoUrl = $payload['canon_url'].$payload['repository']['absolute_url'];
 
         return $this->receivePost($request, $repoUrl, $urlRegex);