Commit f61cba10 authored by Buns Shar's avatar Buns Shar Committed by Joe Haddad
Browse files

Ensure proxy url starts with `http://` or `https://` (#1890)

parent cb41a76e
Showing with 8 additions and 0 deletions
+8 -0
...@@ -89,6 +89,14 @@ module.exports = function addWebpackMiddleware(devServer) { ...@@ -89,6 +89,14 @@ module.exports = function addWebpackMiddleware(devServer) {
) )
); );
process.exit(1); process.exit(1);
// Test that proxy url specified starts with http:// or https://
} else if (!/^http(s)?:\/\//.test(proxy)) {
console.log(
chalk.red(
'When "proxy" is specified in package.json it must start with either http:// or https://'
)
);
process.exit(1);
} }
// Otherwise, if proxy is specified, we will let it handle any request. // Otherwise, if proxy is specified, we will let it handle any request.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment