Skip to content

Commit

Permalink
Fix crash on Checkmk Multisite recheck (#1089)
Browse files Browse the repository at this point in the history
Apparently, between Checkmk 2.2 and 2.3, the csrf_token
hidden input has gotten a _ prefix.

Closes #1085
  • Loading branch information
moschlar authored Jan 26, 2025
1 parent b1568b0 commit 91164e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Nagstamon/Servers/Multisite.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ def _get_csrf_token(self, host, service):
# since Checkmk 2.0 it seems to be a problem if service is empty so fill it with a definitively existing one
if not service:
service = "PING"
csrf_token = self.fetch_url(self.urls["transid"].replace("$HOST$", host).replace("$SERVICE$", service.replace(" ", "+")), "obj").result.find(attrs={"name": "csrf_token"})["value"]
csrf_token = self.fetch_url(self.urls["transid"].replace("$HOST$", host).replace("$SERVICE$", service.replace(" ", "+")),
"obj").result.find(attrs={"name": ["csrf_token", "_csrf_token"]})["value"]
return csrf_token


Expand Down

0 comments on commit 91164e5

Please sign in to comment.