Support at sign in module examples path for flows endpoint

This commit allows an example from an npm package that has
an org scoped name (which includes an @ character) to be retrieved and
loaded properly through the flows endpoint.
This commit is contained in:
Jeremy Barlow
2018-01-29 15:23:19 -08:00
parent 771e43583a
commit 3938550ea8
2 changed files with 50 additions and 3 deletions

View File

@@ -95,7 +95,7 @@ module.exports = {
},
get: function(req,res) {
if (req.params[0].indexOf("_examples_/") === 0) {
var m = /^_examples_\/([^\/]+)\/(.*)$/.exec(req.params[0]);
var m = /^_examples_\/(@.*?\/[^\/]+|[^\/]+)\/(.*)$/.exec(req.params[0]);
if (m) {
var module = m[1];
var path = m[2];