Explorar o código

Merge pull request #317 from ushios/bitbucket

Support Bitbucket git protocol
Jordi Boggiano %!s(int64=11) %!d(string=hai) anos
pai
achega
cd95a43de2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Packagist/WebBundle/Controller/ApiController.php

+ 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);