New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clean errors, add validation & reduce exposed #88

Merged
merged 6 commits into from Aug 30, 2017

Conversation

Projects
None yet
3 participants
@a335926a
Copy link
Contributor

a335926a commented Aug 30, 2017

This PR fixes a few issues listed below:

  • changes errors to be more generic, removing extraneous information to user
  • adds validation for urls to only originate from 'http' or 'https' protocols
  • sorts requires by alphabetical (node, node_modules, project) order
  • only exposes /_ah/stop if NODE_ENV is set to development
  • only exposes progress-bar.html used in application
@googlebot

This comment has been minimized.

Copy link

googlebot commented Aug 30, 2017

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.
@a335926a

This comment has been minimized.

Copy link
Contributor

a335926a commented Aug 30, 2017

I signed it!

@googlebot

This comment has been minimized.

Copy link

googlebot commented Aug 30, 2017

CLAs look good, thanks!

src/main.js Outdated
}
});

app.get('/_ah/health', (request, response) => response.send('OK'));

app.get('/_ah/stop', async(request, response) => {
// only expose chrome disable in development

This comment has been minimized.

@samuelli

samuelli Aug 30, 2017

Member

Let's just remove /_ah/stop entirely.

const testBase = 'http://localhost:1234/';
process.env.NODE_ENV = 'development';

This comment has been minimized.

@samuelli

samuelli Aug 30, 2017

Member

Remove per other comment

src/main.js Outdated
const CONFIG_PATH = path.resolve(__dirname, '../config.json');
const PROGRESS_BAR_PATH = path.resolve(__dirname, '../node_modules/progress-bar-element/progress-bar.html');
const PORT = process.env.PORT || '3000';
const ENVIRONMENT = process.env.NODE_ENV;

This comment has been minimized.

@samuelli

samuelli Aug 30, 2017

Member

Remove per below comment.

@@ -39,8 +47,8 @@ test.before(async(t) => {
async function createServer(config) {
delete require.cache[require.resolve('../src/main.js')];
const app = await require('../src/main.js');
if (config)
app.setConfig(config);
if (config) app.setConfig(config);

This comment has been minimized.

@samuelli

samuelli Aug 30, 2017

Member

Can we leave this on a separate line please?

if (config)
app.setConfig(config);
if (config) app.setConfig(config);
await appInstances.push(app);

This comment has been minimized.

@samuelli

samuelli Aug 30, 2017

Member

await isn't necessary

@a335926a

This comment has been minimized.

Copy link
Contributor

a335926a commented Aug 30, 2017

Covered the changes requested in the latest commit

@samuelli samuelli merged commit 324ac99 into GoogleChrome:master Aug 30, 2017

2 checks passed

cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment