vhernando left a comment (kamailio/kamailio#4508)

Hello Joel,

I think parsing of quotes " depends on Kamailio parsing of configuration files.

Parsing of added tag at the end was a contribution to the module.

One possible solution if you want to sanitize the name part, but to avoid 
sanitizing the added tag part:

https://github.com/kamailio/kamailio/blob/master/src/modules/xhttp_prom/prom.c#L177

Change this part of metric_generate function:

```
        /* Print metric name. */
        if(prom_body_name_printf(ctx, "%.*s%.*s_%.*s%s", 
xhttp_prom_beginning.len,
                           xhttp_prom_beginning.s, group->len, group->s, 
name->len, name->s,
                           xhttp_prom_tags_braces)
                        == -1) {
                LM_ERR("Fail to print\n");
                return -1;
        }
```

 
into this:

```
        /* Print metric name. */
        if(prom_body_name_printf(ctx, "%.*s%.*s_%.*s", xhttp_prom_beginning.len,
                           xhttp_prom_beginning.s, group->len, group->s, 
name->len, name->s)
                        == -1) {
                LM_ERR("Fail to print\n");
                return -1;
        }

        /* xhttp_prom_tags_braces is not sanitized any more because UTF-8 
characters
        are allowed */
        if(prom_body_printf(ctx, "%s", xhttp_prom_tags_braces)
                        == -1) {
                LM_ERR("Fail to print\n");
                return -1;
        }
```



-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4508#issuecomment-3614878466
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/4508/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to