(headers)
| 24 | |
| 25 | |
| 26 | def observe(headers): |
| 27 | if 'via' in headers: |
| 28 | via = headers['via'] |
| 29 | if via: |
| 30 | via = rxp.sub(r'\1 = \5', via) |
| 31 | else: |
| 32 | via = '---empty---' |
| 33 | else: |
| 34 | via = '---missing---' |
| 35 | log.write("Via: {}\n".format(via)) |
| 36 | log.flush() |
| 37 | |
| 38 | |
| 39 | Hooks.register(Hooks.ReadRequestHook, observe) |