mldbai / mldb

MLDB is the Machine Learning Database
http://mldb.ai
Apache License 2.0
661 stars 102 forks source link

connection->sendResponse() --> connection->sendJsonResponse() and UTF-8 #932

Closed jeremybarnes closed 2 years ago

jeremybarnes commented 2 years ago

This improves the API, by ensuring that JSON vs non-JSON responses have a different method name and thus that the semantics don't depend upon the implicit conversions to JSON::Value (or not). That confusion was leading to several places where the content-type was wrong, and worse, when an API was improved to use a UTF8String instead of an ASCII string, it would suddenly send it as a JSON object instead of the string itself.

This is a pure internal API change, with the users of the API updated for the new semantics.