From 9e848d39f7b958165c2e9131229ee65f5fe92dcb Mon Sep 17 00:00:00 2001 From: Tim Robinson Date: Thu, 27 Oct 2016 02:05:08 +0000 Subject: [PATCH 1/2] Allow numbers in provider so c9admin works --- node_modules/c9/hostname.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/c9/hostname.js b/node_modules/c9/hostname.js index 0afb87c1..a12afc58 100644 --- a/node_modules/c9/hostname.js +++ b/node_modules/c9/hostname.js @@ -2,8 +2,8 @@ var fs = require("fs"); exports.parse = function(hostname) { - var m1 = hostname.match(/^([0-9a-z-]+?)-([a-z]+)-([a-z]+)-([0-9]+)-([a-z0-9]+)$/); - var m2 = hostname.match(/^([0-9a-z-]+?)-([a-z]+)-([a-z]+)-([a-z0-9]+)-([a-z0-9]{4})$/); + var m1 = hostname.match(/^([0-9a-z-]+?)-([0-9a-z]+)-([a-z]+)-([0-9]+)-([a-z0-9]+)$/); + var m2 = hostname.match(/^([0-9a-z-]+?)-([0-9a-z]+)-([a-z]+)-([a-z0-9]+)-([a-z0-9]{4})$/); if (m1) { return { From 196667b6257c26f838832dde2d8040e3f15358c5 Mon Sep 17 00:00:00 2001 From: Tim Robinson Date: Thu, 27 Oct 2016 02:06:42 +0000 Subject: [PATCH 2/2] Add test --- node_modules/c9/hostname_test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/node_modules/c9/hostname_test.js b/node_modules/c9/hostname_test.js index face783e..1917ff93 100644 --- a/node_modules/c9/hostname_test.js +++ b/node_modules/c9/hostname_test.js @@ -23,5 +23,6 @@ describe(__filename, function() { assertServerName(hostname.parse("newclient-gce-eu-prod-d4fg"), "newclient", "gce", "eu", "d4fg", "prod"); assertServerName(hostname.parse("ide-old-gce-usw-02-prod"), "ide-old", "gce", "usw", "02", "prod"); assertServerName(hostname.parse("docker-premium-eu-115-prod"), "docker", "premium", "eu", "115", "prod"); + assertServerName(hostname.parse("docker-c9admin-usw-389-prod"), "docker", "c9admin", "usw", "389", "prod"); }); });