Module: check_mk
Branch: master
Commit: 3184bf209725c5826df810db86bc6119d84f330b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3184bf209725c5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 1 15:19:51 2016 +0100
Added helper function to tell caller that this the current request is an API call, not
rendering output to HTML
---
web/htdocs/htmllib.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 4644683..a24fa4f 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -135,6 +135,9 @@ class html(GUITester):
def is_mobile(self):
return self.mobile
+ def is_api_call(self):
+ return self.output_format != "html"
+
def get_user_agent(self):
raise MKGeneralException("get_user_agent not implemented")