@sentry/core
Version:
Base implementation for all Sentry JavaScript SDKs
17 lines (14 loc) • 691 B
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function classifyResponseStreaming(res) {
if (!res.body) {
return { isStreaming: false };
}
const contentType = res.headers.get("content-type") ?? "";
const contentLength = res.headers.get("content-length");
if (/^text\/event-stream\b/i.test(contentType) || /^application\/(x-)?ndjson\b/i.test(contentType) || /^application\/stream\+json\b/i.test(contentType) || /^text\/plain\b/i.test(contentType) && !contentLength) {
return { isStreaming: true };
}
return { isStreaming: false };
}
exports.classifyResponseStreaming = classifyResponseStreaming;
//# sourceMappingURL=responseStreaming.js.map