Repository navigation
Commit 4e02693
committed
Reject non-string Info keys and values in info()
Info.info() accepted any key or value except None. A non-string such as
{'build_number': 42} was stored, and every later scrape of the registry
then failed with AttributeError ("'int' object has no attribute
'replace'"), so one bad call hid all metrics on the endpoint.
Check the types where the value is set, as was done for None in #1012,
so the caller gets a ValueError and the registry stays scrapeable. The
docs already say both keys and values must be strings.
Refs #1046
Signed-off-by: Sonica-B <shreyaa.boyane@gmail.com>1 parent e2f2bf9 commit 4e02693
2 files changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
752 | 755 | | |
753 | 756 | | |
754 | 757 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
587 | 590 | | |
588 | 591 | | |
589 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
590 | 604 | | |
591 | 605 | | |
592 | 606 | | |
| |||
0 commit comments