Skip to content

Commit

Permalink
Ensure proxy url starts with http:// or https:// (#1890)
Browse files Browse the repository at this point in the history
  • Loading branch information
bunshar authored and Timer committed Apr 15, 2017
1 parent cb41a76 commit f61cba1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/react-scripts/scripts/utils/addWebpackMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ module.exports = function addWebpackMiddleware(devServer) {
)
);
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.
Expand Down

0 comments on commit f61cba1

Please sign in to comment.