Commit a0c89bd
authored
alertmanager: Avoid breaking /api/v1/alerts if legacy prefix is empty (#3905)
If the legacy prefix is an empty string, it's interpreted as a handler for `/*`. Any handlers added afterwards are silently ignored, so requests to `/api/v1/alerts` are routed to the legacy handler, rather than to `am.*UserConfig` as would be expected. Meanwhile any handlers added BEFORE the `/*` legacy handler still work as expected - making this very difficult to debug!
Signed-off-by: Nick Parker <nick@nickbp.com>1 parent df80ec1 commit a0c89bd
2 files changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | 175 | | |
183 | 176 | | |
184 | 177 | | |
185 | 178 | | |
186 | 179 | | |
187 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
0 commit comments