export function captureRequestBodyProbe(input) {
    return {
        headers: input.headers,
        hasBody: input.body !== null,
        method: input.method,
        url: new URL(input.url),
    };
}
export function hasCapturedRequestBody(input) {
    const contentLength = input.headers.get('content-length');
    const headerIndicatesBody = (contentLength !== null && contentLength !== '0') || input.headers.has('transfer-encoding');
    if (input.hasBody === true)
        return true;
    return headerIndicatesBody;
}
export function isSessionContentRequest(input) {
    if (input.method === 'HEAD')
        return false;
    if (input.method !== 'POST')
        return true;
    if (input.url?.search)
        return true;
    return hasCapturedRequestBody(input);
}
export function shouldChargePlainResponse(input, payload) {
    if (payload.action === 'close' || payload.action === 'topUp')
        return false;
    return isSessionContentRequest(input);
}
//# sourceMappingURL=request-body.js.map