sprint-es 0.0.147 → 0.0.148
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/dist/cjs/index.cjs
CHANGED
|
@@ -864,7 +864,8 @@ function createSchemaValidationMiddleware(schema) {
|
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
if (schema.headers) {
|
|
867
|
-
const
|
|
867
|
+
const normalizedHeaders = Object.fromEntries(Object.entries(req.headers).map(([key, value]) => [key.toLowerCase(), value]));
|
|
868
|
+
const result = schema.headers.safeParse(normalizedHeaders);
|
|
868
869
|
if (!result.success) {
|
|
869
870
|
errors.push(...result.error.issues.map((issue) => ({
|
|
870
871
|
location: "headers",
|
|
@@ -53,7 +53,8 @@ function defineRouteSchema(schema) {
|
|
|
53
53
|
if (!result.success) errors.push(...result.errors.map((e) => ({ location: "params", ...e })));
|
|
54
54
|
}
|
|
55
55
|
if (schema.headers) {
|
|
56
|
-
const
|
|
56
|
+
const normalizedHeaders = Object.fromEntries(Object.entries(req.headers).map(([key, value]) => [key.toLowerCase(), value]));
|
|
57
|
+
const result = parseSchema(schema.headers, normalizedHeaders);
|
|
57
58
|
if (!result.success) errors.push(...result.errors.map((e) => ({ location: "headers", ...e })));
|
|
58
59
|
}
|
|
59
60
|
if (schema.sprint?.authorization) {
|
package/dist/esm/index.js
CHANGED
|
@@ -839,7 +839,8 @@ function createSchemaValidationMiddleware(schema) {
|
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
841
|
if (schema.headers) {
|
|
842
|
-
const
|
|
842
|
+
const normalizedHeaders = Object.fromEntries(Object.entries(req.headers).map(([key, value]) => [key.toLowerCase(), value]));
|
|
843
|
+
const result = schema.headers.safeParse(normalizedHeaders);
|
|
843
844
|
if (!result.success) {
|
|
844
845
|
errors.push(...result.error.issues.map((issue) => ({
|
|
845
846
|
location: "headers",
|
|
@@ -51,7 +51,8 @@ function defineRouteSchema(schema) {
|
|
|
51
51
|
if (!result.success) errors.push(...result.errors.map((e) => ({ location: "params", ...e })));
|
|
52
52
|
}
|
|
53
53
|
if (schema.headers) {
|
|
54
|
-
const
|
|
54
|
+
const normalizedHeaders = Object.fromEntries(Object.entries(req.headers).map(([key, value]) => [key.toLowerCase(), value]));
|
|
55
|
+
const result = parseSchema(schema.headers, normalizedHeaders);
|
|
55
56
|
if (!result.success) errors.push(...result.errors.map((e) => ({ location: "headers", ...e })));
|
|
56
57
|
}
|
|
57
58
|
if (schema.sprint?.authorization) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAuB,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAuB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAkGlF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,gBAAgB,EAC7D,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAClC,gBAAgB,CAAC,OAAO,CAAC,CAwB3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,SAAS,IAAI,aAAa,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AAErF,MAAM,MAAM,mBAAmB,GAAG,SAAS,MAAM,EAAE,GAAG,WAAW,MAAM,EAAE,CAAC;AAE1E,MAAM,WAAW,0BAA0B;IACvC,OAAO,CAAC,EAAE,mBAAmB,GAAG,mBAAmB,EAAE,CAAC;CACzD;AAED,iBAAS,+BAA+B,CAA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