Skip to content

Commit

Permalink
Merge pull request #100 from AndrewKeig/fix/security-alerts
Browse files Browse the repository at this point in the history
Fix security alerts
  • Loading branch information
AndrewKeig committed Sep 27, 2019
2 parents 38e31a6 + 8856a23 commit 647dc95
Show file tree
Hide file tree
Showing 6 changed files with 1,563 additions and 1,035 deletions.
38 changes: 0 additions & 38 deletions .eslintrc.js

This file was deleted.

41 changes: 41 additions & 0 deletions .eslintrc.yml
@@ -0,0 +1,41 @@
env:
browser: true
commonjs: true
es6: true
globals:
Atomics: readonly
SharedArrayBuffer: readonly
parserOptions:
ecmaVersion: 2018
rules: {
brace-style: [2, '1tbs'],
comma-spacing: 2,
comma-style: [2, 'last'],
default-case: 2,
func-style: [2, 'declaration'],
guard-for-1in: 0,
key-spacing: 2,
new-cap: 1,
no-floating-decimal: 2,
no-mixed-requires: 0,
no-nested-ternary: 2,
no-shadow: 0,
no-undef: 1,
no-underscore-dangle: 0,
no-unused-vars: [1, { vars: 'local', args: 'none' }],
no-use-before-define: [2, 'nofunc'],
object-curly-spacing: [2, 'always'],
keyword-spacing: [2, { after: true, before: true }],
space-before-blocks: 2,
space-before-function-paren: 2,
space-infix-ops: 2,
spaced-comment: 2,
valid-jsdoc: [0, { prefer: { return: 'returns'}}],
wrap-iife: [2, 'any'],
curly: [2, 'multi-line'],
indent: [2, 2],
quotes: [1, 'single'],
radix: 2,
semi: [2, 'always'],
strict: 0
}
16 changes: 13 additions & 3 deletions .travis.yml
@@ -1,5 +1,15 @@
language: node_js

node_js:
- "4.0"
- "4.1"
- "4.2"
- "12"
- "node"

sudo: false

install:
- "npm install"

os:
- "linux"
- "osx"
- "windows"
19 changes: 10 additions & 9 deletions README.md
@@ -1,9 +1,10 @@
express-validation
==================

[![Build Status](https://travis-ci.org/AndrewKeig/express-validation.svg?branch=master)](https://travis-ci.org/AndrewKeig/express-validation)

express-validation is a middleware that validates the `body`, `params`, `query`, `headers` and `cookies` of a request and returns a response with errors; if any of the configured validation rules fail.

[![build status](https://travis-ci.org/AndrewKeig/express-validation.svg)](http://travis-ci.org/AndrewKeig/express-validation)

## Install

Expand Down Expand Up @@ -242,7 +243,7 @@ app.use(function (err, req, res, next) {
## Options

### Unknown schema fields - strict checking
By default, additional fields outside of the schema definition will be ignored by validation.
By default, additional fields outside of the schema definition will be ignored by validation.
To enforce strict checking, set the `allowUnknown\*` options as follows:

```js
Expand Down Expand Up @@ -292,13 +293,13 @@ Thanks to node `require()` caching, all the other `express-validation` instances
### Full options list
Recap of all options usable both as global or per-validation basis.

**allowUnknownBody**: boolean - _default_: `true`
**allowUnknownHeaders**: boolean - _default_: `true`
**allowUnknownQuery**: boolean - _default_: `true`
**allowUnknownParams**: boolean - _default_: `true`
**allowUnknownCookies**: boolean - _default_: `true`
**status**: integer - _default_: `400`
**statusText**: string - _default_: `'Bad Request'`
**allowUnknownBody**: boolean - _default_: `true`
**allowUnknownHeaders**: boolean - _default_: `true`
**allowUnknownQuery**: boolean - _default_: `true`
**allowUnknownParams**: boolean - _default_: `true`
**allowUnknownCookies**: boolean - _default_: `true`
**status**: integer - _default_: `400`
**statusText**: string - _default_: `'Bad Request'`
**contextRequest**: boolean - _default_: `false`

## Changelog
Expand Down

0 comments on commit 647dc95

Please sign in to comment.