Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

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

Merged
merged 6 commits into from Aug 30, 2017

Conversation

a335926a
Copy link
Contributor

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
Copy link

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
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just remove /_ah/stop entirely.

test/app-test.js Outdated
const testBase = 'http://localhost:1234/';
process.env.NODE_ENV = 'development';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove per below comment.

test/app-test.js Outdated
@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leave this on a separate line please?

test/app-test.js Outdated
if (config)
app.setConfig(config);
if (config) app.setConfig(config);
await appInstances.push(app);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await isn't necessary

@a335926a
Copy link
Contributor Author

Covered the changes requested in the latest commit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants