canonic-epicure/KiokuJS-Backend-CouchDB

Trying to store UTF-8 chars fails with 400 error

Closed this issue · 2 comments

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?

Emacs says the file i tested is utf-8, by the way

Bug was in HTTP-Request-Provider,
Fix available at canonic-epicure/HTTP-Request-Provider#1