mirror of
https://github.com/sprockets/sprockets-influxdb.git
synced 2024-11-14 19:29:29 +00:00
Fix response header parsing in python3
This commit is contained in:
parent
080a480ff7
commit
a22c66fda5
1 changed files with 3 additions and 3 deletions
|
@ -73,7 +73,7 @@ class InfluxDBMixin(object):
|
|||
handler = '{}.{}'.format(self.__module__, self.__class__.__name__)
|
||||
self.influxdb.set_tags({'handler': handler, 'method': request.method})
|
||||
if request.headers.get('Accept'):
|
||||
accept = request.headers['Accept'].split(';')[0].strip()
|
||||
accept = request.headers.get('Accept').split(';')[0].strip()
|
||||
self.influxdb.set_tag('accept', accept)
|
||||
for host, handlers in application.handlers:
|
||||
if not host.match(request.host):
|
||||
|
@ -89,8 +89,8 @@ class InfluxDBMixin(object):
|
|||
if hasattr(self, 'correlation_id'):
|
||||
self.influxdb.set_tag('correlation_id', self.correlation_id)
|
||||
self.influxdb.set_tag('status_code', self._status_code)
|
||||
content_type = self._headers['Content-Type'].split(';')[0].strip()
|
||||
self.influxdb.set_tag('content_type', content_type)
|
||||
ctype = self._headers['Content-Type'].decode('utf-8')
|
||||
self.influxdb.set_tag('content_type', ctype.split(';')[0].strip())
|
||||
self.influxdb.set_field('duration', self.request.request_time())
|
||||
self.influxdb.set_field('content_length',
|
||||
int(self._headers['Content-Length']))
|
||||
|
|
Loading…
Reference in a new issue