diff --git a/README.md b/README.md index ffd8abb..e0a8595 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ const Humanoid = require("humanoid-js"); let humanoid = new Humanoid(); humanoid.get("https://www.cloudflare-protected.com") .then(res => { - console.log(res.body) // ... + console.log(res.body.toString()) // ... }) .catch(err => { console.error(err) @@ -51,7 +51,7 @@ humanoid.get("https://canyoupwn.me") humanoid.bypassJSChallenge(res) .then(challengeResponse => { // Note that challengeResponse.isChallengeSolved won't be set to true when doing manual bypassing. - console.log(challengeResponse.body) // ... + console.log(challengeResponse.body.toString()) // ... }) } ) @@ -64,7 +64,7 @@ humanoid.get("https://canyoupwn.me") (async function() { let humanoid = new Humanoid(); let response = await humanoid.sendRequest("www.cloudflare-protected.com") - console.log(response.body) // ... + console.log(response.body.toString()) // ... }()) ``` ### Humanoid API Methods diff --git a/package.json b/package.json index e74bf63..1979f42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "humanoid-js", - "version": "1.0.1", + "version": "1.0.2", "description": "Node.js package to bypass WAF anti-bot JavaScript challenges", "repository": { "type": "git", diff --git a/src/humanoidReqHandler.js b/src/humanoidReqHandler.js index 4699922..6125128 100644 --- a/src/humanoidReqHandler.js +++ b/src/humanoidReqHandler.js @@ -85,7 +85,6 @@ class HumanoidReqHandler { let res = await rpn(url, currConfig); // Decompress Brotli content-type if returned (Unsupported natively by `request`) res = res.headers["content-encoding"] === "br" ? await this._decompressBrotli(res) : res; - res.body = res.body.toString(); if (this.isCaptchaInResponse(res.body)) { throw Error("CAPTCHA page encountered. Cannot perform bypass.")