You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
547 B
19 lines
547 B
# Copyright (C) 2005-2024 Splunk Inc. All Rights Reserved.
|
|
|
|
import json
|
|
import splunk.rest
|
|
|
|
class BaseSplunkdRest(splunk.rest.BaseRestHandler):
|
|
"""
|
|
Base class for all of ITSI's splunkd endpoints
|
|
"""
|
|
def render_json(self, response_data):
|
|
'''
|
|
given data, convert it to a JSON which is consumable by a web client
|
|
'''
|
|
response = json.dumps(response_data).replace("</", "<\\/")
|
|
|
|
# Pad with 256 bytes of whitespace for IE security issue. See SPL-34355
|
|
return ' ' * 256 + '\n' + response
|
|
|