//#region lib/util/http/hooks.ts
function isResponseOk(response) {
	const { statusCode } = response;
	const limitStatusCode = response.request.options.followRedirect ? 299 : 399;
	return statusCode >= 200 && statusCode <= limitStatusCode || statusCode === 304;
}
function hook(response) {
	if (isResponseOk(response)) response.request.destroy();
	return response;
}
const hooks = { afterResponse: [hook] };
//#endregion
export { hooks };

//# sourceMappingURL=hooks.js.map