Browse Source

Merge pull request #317 from ushios/bitbucket

Support Bitbucket git protocol
Jordi Boggiano 11 years ago
parent
commit
cd95a43de2
1 changed files with 1 additions and 1 deletions
  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);