@odatnurd/cf-requests 0.1.3 → 0.1.4
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/aegis/index.js +8 -5
- package/package.json +1 -1
package/aegis/index.js
CHANGED
|
@@ -26,7 +26,7 @@ export function initializeRequestChecks() {
|
|
|
26
26
|
);
|
|
27
27
|
|
|
28
28
|
addCheck.value.isResponseWithStatus(
|
|
29
|
-
(source, status) => source instanceof Response && source.status
|
|
29
|
+
(source, status) => source instanceof Response && source.status === status
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -78,14 +78,17 @@ export async function schemaTest(dataType, schema, data, validator) {
|
|
|
78
78
|
param: () => data,
|
|
79
79
|
json: async () => data,
|
|
80
80
|
query: () => data,
|
|
81
|
+
header: () => data,
|
|
82
|
+
cookie: () => data,
|
|
83
|
+
form: async () => data,
|
|
81
84
|
|
|
82
85
|
// The validator invokes this to get headers out of the request when the
|
|
83
86
|
// data type is JSON.
|
|
84
87
|
header: (name) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
return name.toLowerCase() !== 'content-type' ? undefined : {
|
|
89
|
+
json: 'application/json',
|
|
90
|
+
form: 'multipart/form-data',
|
|
91
|
+
}[dataType];
|
|
89
92
|
},
|
|
90
93
|
|
|
91
94
|
// When validation succeeds, it invokes this to store the data back into
|
package/package.json
CHANGED