diff --git a/mongoose.h b/mongoose.h index 2994c2ce..131cefc4 100644 --- a/mongoose.h +++ b/mongoose.h @@ -3250,7 +3250,7 @@ static inline bool mg_parse_field(struct mg_str json, struct mg_field *f, } else if (f->type == MG_VAL_DBL) { ok = mg_json_get_num(json, "$", &val->d); } else if (f->type == MG_VAL_STR) { - val->s = trimq(json); + val->s = json; } else if (f->type == MG_VAL_FN) { val->s = json; } diff --git a/src/dash.h b/src/dash.h index 40b112bf..b09e3097 100644 --- a/src/dash.h +++ b/src/dash.h @@ -112,7 +112,7 @@ static inline bool mg_parse_field(struct mg_str json, struct mg_field *f, } else if (f->type == MG_VAL_DBL) { ok = mg_json_get_num(json, "$", &val->d); } else if (f->type == MG_VAL_STR) { - val->s = trimq(json); + val->s = json; } else if (f->type == MG_VAL_FN) { val->s = json; } diff --git a/tutorials/device-dashboard/settings-panel/server.c b/tutorials/device-dashboard/settings-panel/server.c index 0e418228..b9bb9f37 100644 --- a/tutorials/device-dashboard/settings-panel/server.c +++ b/tutorials/device-dashboard/settings-panel/server.c @@ -16,7 +16,7 @@ static void location_get(union mg_val *val) { val->s = mg_str(s_location); } static void location_set(const union mg_val *val) { - mg_json_unescape(val->s, s_location, sizeof(s_location)); + mg_json_unescape(val->s, "$", s_location, sizeof(s_location)); } static void threshold_get(union mg_val *val) {