Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where data was not being sanitized for event data #32

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions customerio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def send_request(self, method, url, data):
'''Dispatches the request and returns a response'''

try:
response = self.http.request(method, url=url, json=self._sanitize(data), timeout=self.timeout)
response = self.http.request(method, url=url, json=data, timeout=self.timeout)
except Exception as e:
# Raise exception alerting user that the system might be
# experiencing an outage and refer them to system status page.
Expand All @@ -88,14 +88,14 @@ def send_request(self, method, url, data):
def identify(self, id, **kwargs):
'''Identify a single customer by their unique id, and optionally add attributes'''
url = self.get_customer_query_string(id)
self.send_request('PUT', url, kwargs)
self.send_request('PUT', url, self._sanitize(kwargs))

def track(self, customer_id, name, **data):
'''Track an event for a given customer_id'''
url = self.get_event_query_string(customer_id)
post_data = {
'name': name,
'data': data,
'data': self._sanitize(data),
}
self.send_request('POST', url, post_data)

Expand All @@ -105,7 +105,7 @@ def pageview(self, customer_id, page, **data):
post_data = {
'type': "page",
'name': page,
'data': data,
'data': self._sanitize(data),
}
self.send_request('POST', url, post_data)

Expand All @@ -123,7 +123,7 @@ def backfill(self, customer_id, name, timestamp, **data):

post_data = {
'name': name,
'data': data,
'data': self._sanitize(data),
'timestamp': timestamp
}

Expand Down