Trying to store UTF-8 chars fails with 400 error
Closed this issue · 2 comments
bergmark commented
Stumbled upon this bug:
require('task-joose-nodejs');
use('KiokuJS.Backend.CouchDB', function () {
var url = "http://localhost:5984/test";
var handle = new KiokuJS.Backend.CouchDB({ dbURL : url });
handle.newScope().store({ name : "ö" }).now();
});
This code generates the following HTTP request
{"className":"Object","isRoot":true,"data":{"name":"ö"},"$entry":true,"_id":"5BB35415-C202-7AA1-910B-0DDF288782F9"}
To which Couch responds
{ status: 400, text: '{"error":"bad_request","reason":"invalid UTF-8 JSON"}\n' }
Not sure where the problem lies. Any ideas?
bergmark commented
Emacs says the file i tested is utf-8, by the way
bergmark commented
Bug was in HTTP-Request-Provider,
Fix available at canonic-epicure/HTTP-Request-Provider#1