diff --git a/sprockets_influxdb.py b/sprockets_influxdb.py index 90f41eb..5856adc 100644 --- a/sprockets_influxdb.py +++ b/sprockets_influxdb.py @@ -89,7 +89,8 @@ class InfluxDBMixin(object): if hasattr(self, 'correlation_id'): self.influxdb.set_field('correlation_id', self.correlation_id) self.influxdb.set_field('duration', self.request.request_time()) - parsed = headers.parse_content_type(self._headers['Content-Type']) + parsed = headers.parse_content_type( + self._headers['Content-Type'].decode('utf-8')) self.influxdb.set_tag( 'content_type', '{}/{}'.format( parsed.content_type, parsed.content_subtype)) diff --git a/tests/base.py b/tests/base.py index 933722d..a640c76 100644 --- a/tests/base.py +++ b/tests/base.py @@ -156,7 +156,7 @@ class FakeInfluxDBHandler(web.RequestHandler): payload = self.request.body.decode('utf-8') for line in payload.splitlines(): LOGGER.debug('Line: %r', line) - parts = LINE_PATTERN.match(line.encode('utf-8')) + parts = LINE_PATTERN.match(line) name, tags_str, fields_str, timestamp = parts.groups() matches = TAG_PATTERN.findall(tags_str)