mirror of
https://github.com/OpenMTC/OpenMTC.git
synced 2025-02-01 00:15:24 +00:00
fixes chunked data receiving in notification http server
This commit is contained in:
parent
5c83578524
commit
f624ac1fe5
@ -256,6 +256,13 @@ class HttpNotificationHandler(BaseNotificationHandler):
|
||||
assert 'x-m2m-ri' in request.headers, 'Missing request id'
|
||||
assert 'content-type' in request.headers, 'Unspecified content type'
|
||||
|
||||
if not request.data:
|
||||
if request.environ.get('HTTP_TRANSFER_ENCODING') == 'chunked':
|
||||
request.data = request.environ['wsgi.input'].read()
|
||||
else:
|
||||
cl = int(request.environ.get('CONTENT_LENGTH'), 0)
|
||||
request.data = request.environ['wsgi.input'].read(cl)
|
||||
|
||||
notification = get_onem2m_decoder(request.content_type).decode(request.data)
|
||||
if not notification.verificationRequest:
|
||||
notification = self._unpack_notification(notification)
|
||||
|
Loading…
x
Reference in New Issue
Block a user