gilesbrown / python-icapservice

An ICAP service library for Python
MIT License
1 stars 0 forks source link

`int('', 16)` being called when `decode_deflate` requests chunks #5

Open ghost opened 8 years ago

ghost commented 8 years ago
'RESPMOD icap://127.0.0.1:1344/respmod ICAP/1.0\r\n'
https://www.google.com/xjs/_/js/k=xjs.s.en_US.C3nIAsmzXu8.O/m=sx,c,sb,cdos,cr,elog,jsa,r,hsm,qsm,j,p,d,csi/am=AJQkAYRE_H8ICLcQLEgFGAwC/rt=j/d=1/t=zcms/rs=ACT90oEmWk3lXzBP9bcM3b4YeE6Ql99PgA

inject_scrapes: False ignore_list: True
INFO:icapservice.handler:"RESPMOD /respmod GET https://www.google.com/xjs/_/js/k=xjs.s.en_US.C3nIAsmzXu8.O/m=sx,c,sb,cdos,cr,elog,jsa,r,hsm,qsm,j,p,d,csi/am=AJQkAYRE_H8ICLcQLEgFGAwC/rt=j/d=1/t=zcms/rs=ACT90oEmWk3lXzBP9bcM3b4YeE6Ql99PgA" - 200
894

541

541

541

541

541

541

541

541

541

541

541

541

541

541

541

541

541

541

541

541

541

541

3d6

541

541

541

541

541

541

541

541

541

541

541

541

541

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/icapservice/handler.py", line 47, in __init__
    StreamRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
    self.handle()
  File "/usr/local/lib/python2.7/dist-packages/icapservice/handler.py", line 123, in handle
    self.handle_one_request()
  File "/usr/local/lib/python2.7/dist-packages/icapservice/handler.py", line 110, in handle_one_request
    self.respond(icap_request, icap_response)
  File "/usr/local/lib/python2.7/dist-packages/icapservice/handler.py", line 165, in respond
    for chunk in chain(first_chunk, chunks):
  File "/vagrant/serve.py", line 256, in insert_script
    for chunk in chunks:
  File "/usr/local/lib/python2.7/dist-packages/icapservice/content.py", line 21, in decode_deflate
    for chunk in chunks:
  File "/usr/local/lib/python2.7/dist-packages/icapservice/request.py", line 174, in _chunks
    for chunk in read_chunks(self.fp):
  File "/usr/local/lib/python2.7/dist-packages/icapservice/request.py", line 190, in read_chunks
    chunk_size = int(chunk_size, 16)
ValueError: invalid literal for int() with base 16: ''
<Greenlet at 0x7f2022380690: ICAPServicesRequestHandler(<socket at 0x7f202143afd0 fileno=11 sock=127.0.0.1, ('127.0.0.1', 59064))> failed with ValueError
gilesbrown commented 4 years ago

That's annoying.