Hi, I found a bug in which the WebServer is sending a duplicated Content-Length header. I was trying to use Python requests lib and it was blocking the program execution. The requested URL was "http://127.0.0.1:5513/?slc=get¶m1=lastcaptured¶m2"
Pythons urllib doesn`t know how to deal with '12, 12'content-length and blocks the program flow (probably it's waiting to receive infinite bytes)
I did the following workaround:
def execute(self, params):
call_url = '{}/?{}'.format(DIGICAM_URL, params)
stream = urlopen(call_url, timeout=2)
# Digicam control has a bug in which sends duplicated Content-Length
# Urllib doesn`t know how to deal with this size, and blocks the program flow
content_length = stream.headers.getheader('Content-Length') # It may return '12, 12'
real_content_length = int(content_length.split(',')[0])
content = stream.read(real_content_length)
stream.close()
return content
Hi, I found a bug in which the WebServer is sending a duplicated Content-Length header. I was trying to use Python requests lib and it was blocking the program execution. The requested URL was "http://127.0.0.1:5513/?slc=get¶m1=lastcaptured¶m2"
Here is the Headers dict that I'm receiving:
Pythons urllib doesn`t know how to deal with '12, 12'content-length and blocks the program flow (probably it's waiting to receive infinite bytes)
I did the following workaround: