diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/library.js b/packages/node_modules/@node-red/editor-client/src/js/ui/library.js index f99cdf0a8..2f7559411 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/library.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/library.js @@ -458,7 +458,10 @@ RED.library = (function() { click: function() { //TODO: move this to RED.library var flowName = $("#node-input-library-filename").val(); - if (!/^\s*$/.test(flowName)) { + flowName = flowName.trim(); + if(flowName === "" || flowName.endsWith("/")) { + RED.notify(RED._("library.invalidFilename"),"warning"); + } else { $.ajax({ url:'library/flows/'+flowName, type: "POST", diff --git a/packages/node_modules/node-red/red.js b/packages/node_modules/node-red/red.js index 90d1ad3c1..337eb44e8 100755 --- a/packages/node_modules/node-red/red.js +++ b/packages/node_modules/node-red/red.js @@ -247,7 +247,7 @@ function basicAuthMiddleware(user,pass) { } var requestUser = basicAuth(req); if (!requestUser || requestUser.name !== user || !checkPasswordAndCache(requestUser.pass)) { - res.set('WWW-Authenticate', 'Basic realm=Authorization Required'); + res.set('WWW-Authenticate', 'Basic realm="Authorization Required"'); return res.sendStatus(401); } next();