ucl_object_tostring (cur));
}
else if (g_ascii_strcasecmp (ucl_object_key (cur), "urls") == 0) {
- emitted = ucl_object_emit (cur, UCL_EMIT_JSON_COMPACT);
+ if (!extended_urls) {
+ emitted = ucl_object_emit (cur, UCL_EMIT_JSON_COMPACT);
+ }
+ else {
+ emitted = ucl_object_emit (cur, UCL_EMIT_JSON);
+ }
rspamd_fprintf (stdout, "Urls: %s\n", emitted);
free (emitted);
}
elt = ucl_object_fromstring (url->string);
ucl_object_insert_key (obj, elt, "url", 0, false);
- elt = ucl_object_fromlstring (url->host, url->hostlen);
- ucl_object_insert_key (obj, elt, "host", 0, false);
-
- elt = ucl_object_fromlstring (url->data, url->datalen);
- ucl_object_insert_key (obj, elt, "data", 0, false);
+ if (url->hostlen > 0) {
+ elt = ucl_object_fromlstring (url->host, url->hostlen);
+ ucl_object_insert_key (obj, elt, "host", 0, false);
+ }
- if (url->surbl) {
+ if (url->surbllen > 0) {
elt = ucl_object_fromlstring (url->surbl, url->surbllen);
ucl_object_insert_key (obj, elt, "surbl", 0, false);
}