node.js - KrakenJS: perform POST request over a controller ends with error -


i'm using krakenjs build web app. being mvc, i'm implenting rest service controller, here's sample code:

//users can data app.get('myroute', function (req, res) {     readdata(); });  //users can send data app.post('myroute', function (req, res) {     writedata(); }); 

i can read data no problems. when try dummy data insertion post requests, ends error:

error:forbidden 127.0.0.1 - - [thu, 06 feb 2014 00:11:30 gmt] "post /myroute http/1.1" 500 374 "-" "mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) ubuntu chromium/32.0.1700.102 chrome/32.0.1700.102 safari/537.36"

how can overcome this?

one thing make sure you're sending correct csrf headers (http://krakenjs.com/#security). if remember correctly, default kraken expects headers specified.

you can disable csrf , see if fixes problem. since kraken uses lusca module csrf, can information on how disable/configure here: https://github.com/paypal/lusca


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -