Comments (4)
Weird, ..
could you put a log statement right before the parse statement on line 44
response.on('end', function() {
console.log(options, body); // add this one
// also to prevent the crash you wrap it with a try/catch
var data = {};
try{ data = JSON.parse( body ); }
catch (e) {}
if (!data.success) return cb(new Error(data['error-codes']));
cb(null);
});
the simple-recaptcha module that I'm using a fork, so we can't create issues but we can create pull requests if you can help me debug the issue
Remember to obfuscate your private key if it shows up in the logs
from nodebb-plugin-spam-be-gone.
Changes have been applied and I've activated recaptcha again, I'll report back once I get another error.
from nodebb-plugin-spam-be-gone.
There we go, now I have an update for you;
{ host: 'www.google.com',
port: 443,
path: '/recaptcha/api/siteverify?secret=REDACTED &remoteip=REDACTED&response=REDACTED',
method: 'GET',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' } } '<!DOCTYPE html>\n<html lang=en>\n <meta charset=utf-8>\n <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">\n <title>Error 400 (Bad Request)!!1</title>\n <style>\n *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/errors/logo_sm_2.png) no-repeat}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/errors/logo_sm_2_hr.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/errors/logo_sm_2_hr.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/errors/logo_sm_2_hr.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:55px;width:150px}\n </style>\n <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n <p><b>400.</b> <ins>That’s an error.</ins>\n <p>Your client has issued a malformed or illegal request. <ins>That’s all we know.</ins>\n'
Error: [SyntaxError: Unexpected token <]
I think the problem is that a space seems to have appeared at the end of my private key, no idea when this happened though since I haven't touched the keys since first adding them when installing the plugin...
Maybe something to check, just to be sure. Strip spaces from the value when saving, if they're going to be fed directly into a request URI later on.
from nodebb-plugin-spam-be-gone.
ah ok, thanks, I will also add a try/catch block in the core so it won't crash the server.
from nodebb-plugin-spam-be-gone.
Related Issues (20)
- using a deprecated hook HOT 1
- NodeBB 1.5.2 Recaptcha Not displaying HOT 1
- Admins and moderators should be exempt
- Support stopforumspam HOT 2
- Legit user is unable to post HOT 4
- CAPTCHA does not always show up on cold load of /register HOT 20
- Captcha not showing HOT 2
- Use recaptcha.net to replace google.com/recaptcha HOT 1
- Missing stopforumspam parameters? HOT 3
- Plugin v.0.7.0 not working HOT 3
- reCAPTCHA succeeds but NodeBB thinks it fails. HOT 3
- Can I use Google reCaptcha on the login page? HOT 1
- ReCAPTCHA loading twice HOT 17
- hCaptcha API.js is downloaded even when hCaptcha is disabled HOT 2
- hCaptcha succeeds but NodeBB thinks it fails HOT 2
- StopForumSpam issues. HOT 3
- show stats from stop forum spam HOT 1
- recaptcha v3 support? HOT 4
- is this plugin still alive? HOT 5
- add setting to disable login hcaptcha like recaptcha
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodebb-plugin-spam-be-gone.