@openaddresses/batch-schema 7.0.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v7.1.0
14
+
15
+ - :bug: Only validate response on 200 status
16
+
13
17
  ### v7.0.0
14
18
 
15
19
  - :rocket: Remove PublicError class to it's own package
package/lib/middleware.js CHANGED
@@ -110,7 +110,9 @@ export default class Middleware {
110
110
  return function (req, res, next) {
111
111
  const json = res.json;
112
112
  res.json = function(obj) {
113
- validate(obj);
113
+ if (res.statusCode === null || res.statusCode === 200) {
114
+ validate(obj);
115
+ }
114
116
 
115
117
  json.call(this, obj);
116
118
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "root": true,
5
5
  "main": "index.js",
6
- "version": "7.0.0",
6
+ "version": "7.1.0",
7
7
  "description": "Strongly Validated JSON Schema support for address",
8
8
  "repository": "git@github.com:openaddresses/batch-schema",
9
9
  "author": "ingalls <nick@ingalls.ca>",