fastify-txstate 3.3.3 → 3.3.5
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/lib/index.js +5 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -57,7 +57,7 @@ exports.prodLogger = {
|
|
|
57
57
|
url: res.request?.url.replace(/(token|unifiedJwt)=[\w.]+/i, '$1=redacted'),
|
|
58
58
|
length: Number((0, txstate_utils_1.toArray)(res.getHeader?.('content-length'))[0]),
|
|
59
59
|
...res.extraLogInfo,
|
|
60
|
-
auth: res.request?.auth ?? res.extraLogInfo
|
|
60
|
+
auth: res.request?.auth ?? res.extraLogInfo?.auth
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -262,6 +262,8 @@ class Server {
|
|
|
262
262
|
for (const ov of v.params.errors) {
|
|
263
263
|
if (['type', 'additionalProperties', 'minProperties'].includes(ov.keyword))
|
|
264
264
|
developerErrors.push({ ...ov, message: v.message });
|
|
265
|
+
else if (ov.keyword === 'required')
|
|
266
|
+
userErrors.push({ ...ov, message: 'This field is required.' });
|
|
265
267
|
else
|
|
266
268
|
userErrors.push({ ...ov, message: v.message });
|
|
267
269
|
}
|
|
@@ -269,6 +271,8 @@ class Server {
|
|
|
269
271
|
else {
|
|
270
272
|
if (['type', 'additionalProperties', 'minProperties'].includes(v.keyword))
|
|
271
273
|
developerErrors.push(v);
|
|
274
|
+
else if (v.keyword === 'required')
|
|
275
|
+
userErrors.push({ ...v, message: 'This field is required.' });
|
|
272
276
|
else
|
|
273
277
|
userErrors.push(v);
|
|
274
278
|
}
|