vovk 3.0.0-draft.60 → 3.0.0-draft.61
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.
|
@@ -39,12 +39,12 @@ const defaultFetcher = async ({ httpMethod, getEndpoint, validate, defaultHandle
|
|
|
39
39
|
throw new HttpException_1.HttpException(types_1.HttpStatus.NULL, e?.message ?? exports.DEFAULT_ERROR_MESSAGE);
|
|
40
40
|
}
|
|
41
41
|
const contentType = response.headers.get('content-type');
|
|
42
|
-
if (contentType?.
|
|
43
|
-
return defaultStreamHandler(response);
|
|
44
|
-
}
|
|
45
|
-
if (contentType?.includes('application/json')) {
|
|
42
|
+
if (contentType?.startsWith('application/json')) {
|
|
46
43
|
return defaultHandler(response);
|
|
47
44
|
}
|
|
45
|
+
if (contentType === 'text/plain; format=jsonlines') {
|
|
46
|
+
return defaultStreamHandler(response);
|
|
47
|
+
}
|
|
48
48
|
return response;
|
|
49
49
|
};
|
|
50
50
|
exports.default = defaultFetcher;
|
package/package.json
CHANGED
|
@@ -45,14 +45,16 @@ const defaultFetcher: VovkClientFetcher<VovkDefaultFetcherOptions> = async (
|
|
|
45
45
|
|
|
46
46
|
const contentType = response.headers.get('content-type');
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
return defaultStreamHandler(response);
|
|
50
|
-
}
|
|
48
|
+
|
|
51
49
|
|
|
52
|
-
if (contentType?.
|
|
50
|
+
if (contentType?.startsWith('application/json')) {
|
|
53
51
|
return defaultHandler(response);
|
|
54
52
|
}
|
|
55
53
|
|
|
54
|
+
if (contentType === 'text/plain; format=jsonlines') {
|
|
55
|
+
return defaultStreamHandler(response);
|
|
56
|
+
}
|
|
57
|
+
|
|
56
58
|
return response;
|
|
57
59
|
};
|
|
58
60
|
|