mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-26 06:10:29 +01:00
server : fix crash when error handler dumps invalid utf-8 json (#9195)
This commit is contained in:
parent
1d1ccce676
commit
9f7d4bcf5c
@ -2572,7 +2572,7 @@ int main(int argc, char ** argv) {
|
||||
|
||||
auto res_error = [](httplib::Response & res, json error_data) {
|
||||
json final_response {{"error", error_data}};
|
||||
res.set_content(final_response.dump(), MIMETYPE_JSON);
|
||||
res.set_content(final_response.dump(-1, ' ', false, json::error_handler_t::replace), MIMETYPE_JSON);
|
||||
res.status = json_value(error_data, "code", 500);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user