mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-12-03 02:37:06 +03:00
send notice ids in the request body (#25142)
Notice ids went into the URL path, and nginx decodes the path, merges slashes, and resolves dot segments before proxying. A detector named zmq:tcp://host:5555 came through as tcp:/host, so its notice 404'd and couldn't be acknowledged or muted. The same happened to failed_login notices for usernames containing // or /../. Acknowledge, mute, and unhide now take the id in a JSON body at /notices/acknowledge, /notices/mute, and /notices/unhide.
This commit is contained in:
@@ -58,7 +58,7 @@ export function useHealthProblems(
|
||||
|
||||
const muteCheck = useCallback(
|
||||
async (id: string) => {
|
||||
await axios.post(`notices/${encodeURIComponent(id)}/mute`);
|
||||
await axios.post("notices/mute", { id });
|
||||
mutateMutedChecks();
|
||||
},
|
||||
[mutateMutedChecks],
|
||||
@@ -66,7 +66,7 @@ export function useHealthProblems(
|
||||
|
||||
const unmuteCheck = useCallback(
|
||||
async (id: string) => {
|
||||
await axios.delete(`notices/${encodeURIComponent(id)}/hidden`);
|
||||
await axios.post("notices/unhide", { id });
|
||||
mutateMutedChecks();
|
||||
},
|
||||
[mutateMutedChecks],
|
||||
|
||||
@@ -60,17 +60,15 @@ export function useNotices(showHidden: boolean) {
|
||||
);
|
||||
|
||||
const acknowledge = useCallback(
|
||||
(id: string) =>
|
||||
act(axios.post(`notices/${encodeURIComponent(id)}/acknowledge`)),
|
||||
(id: string) => act(axios.post("notices/acknowledge", { id })),
|
||||
[act],
|
||||
);
|
||||
const mute = useCallback(
|
||||
(id: string) => act(axios.post(`notices/${encodeURIComponent(id)}/mute`)),
|
||||
(id: string) => act(axios.post("notices/mute", { id })),
|
||||
[act],
|
||||
);
|
||||
const unhide = useCallback(
|
||||
(id: string) =>
|
||||
act(axios.delete(`notices/${encodeURIComponent(id)}/hidden`)),
|
||||
(id: string) => act(axios.post("notices/unhide", { id })),
|
||||
[act],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user