akhoury / nodebb-plugin-spam-be-gone

yup
MIT License
24 stars 25 forks source link

nodebb 1.2 and re-captcha, nodebb restart #53

Closed spwolf closed 6 years ago

spwolf commented 8 years ago

With nodebb 1.2, and enabled re-captcha on signup, we get nodebb server restart after user verifies via re-captcha.

here is the error message:

5/10 06:09 [16434] - error: TypeError: Request path contains unescaped characters.
    at new ClientRequest (_http_client.js:50:11)
    at Object.exports.request (http.js:31:10)
    at Object.socket.once.exports.request (https.js:182:15)
    at module.exports (/var/nodebb/NodeBB/node_modules/nodebb-plugin-spam-be-gone/node_modules/simple-recaptcha-new/index.js:37:23)
    at Object.Plugin._recaptchaCheck (/var/nodebb/NodeBB/node_modules/nodebb-plugin-spam-be-gone/library.js:261:3)
    at /var/nodebb/NodeBB/node_modules/nodebb-plugin-spam-be-gone/library.js:193:11
    at /var/nodebb/NodeBB/node_modules/async/lib/async.js:718:13
    at async.forEachOf.async.eachOf (/var/nodebb/NodeBB/node_modules/async/lib/async.js:233:13)
    at _parallel (/var/nodebb/NodeBB/node_modules/async/lib/async.js:717:9)
    at Object.async.parallel (/var/nodebb/NodeBB/node_modules/async/lib/async.js:731:9)
    at Object.Plugin.checkRegister [as method] (/var/nodebb/NodeBB/node_modules/nodebb-plugin-spam-be-gone/library.js:188:8)
    at /var/nodebb/NodeBB/src/plugins/hooks.js:114:12
    at /var/nodebb/NodeBB/node_modules/async/lib/async.js:375:13
    at iterate (/var/nodebb/NodeBB/node_modules/async/lib/async.js:262:13)
    at Object.async.forEachOfSeries.async.eachOfSeries (/var/nodebb/NodeBB/node_modules/async/lib/async.js:281:9)
    at Object.async.inject.async.foldl.async.reduce (/var/nodebb/NodeBB/node_modules/async/lib/async.js:374:15)
TypeError: Request path contains unescaped characters.
    at new ClientRequest (_http_client.js:50:11)
    at Object.exports.request (http.js:31:10)
    at Object.socket.once.exports.request (https.js:182:15)
    at module.exports (/var/nodebb/NodeBB/node_modules/nodebb-plugin-spam-be-gone/node_modules/simple-recaptcha-new/index.js:37:23)
    at Object.Plugin._recaptchaCheck (/var/nodebb/NodeBB/node_modules/nodebb-plugin-spam-be-gone/library.js:261:3)
    at /var/nodebb/NodeBB/node_modules/nodebb-plugin-spam-be-gone/library.js:193:11
    at /var/nodebb/NodeBB/node_modules/async/lib/async.js:718:13
    at async.forEachOf.async.eachOf (/var/nodebb/NodeBB/node_modules/async/lib/async.js:233:13)
    at _parallel (/var/nodebb/NodeBB/node_modules/async/lib/async.js:717:9)
    at Object.async.parallel (/var/nodebb/NodeBB/node_modules/async/lib/async.js:731:9)
    at Object.Plugin.checkRegister [as method] (/var/nodebb/NodeBB/node_modules/nodebb-plugin-spam-be-gone/library.js:188:8)
    at /var/nodebb/NodeBB/src/plugins/hooks.js:114:12
    at /var/nodebb/NodeBB/node_modules/async/lib/async.js:375:13
    at iterate (/var/nodebb/NodeBB/node_modules/async/lib/async.js:262:13)
    at Object.async.forEachOfSeries.async.eachOfSeries (/var/nodebb/NodeBB/node_modules/async/lib/async.js:281:9)
    at Object.async.inject.async.foldl.async.reduce (/var/nodebb/NodeBB/node_modules/async/lib/async.js:374:15)
akhoury commented 8 years ago

can you put a log statement at this line: https://github.com/akhoury/nodebb-plugin-spam-be-gone/blob/master/library.js#L260

console.log(
   pluginSettings.recaptchaPrivateKey,
   req.ip,
   req.body['g-recaptcha-response']
);
akhoury commented 8 years ago

i cannot reproduce this issue, we might just have to encodeURIComponent() all 3 values

barisusakli commented 6 years ago

@spwolf please respond if you still have this issue with the output of the console.log above