Closed baali closed 4 years ago
So the bug in the example is that the function signature is actually
filter(request, response, self)
in the code.
A potential second bug is that this final self
argument is called warc_writer
in test_capture_http.py
, which makes me wonder if @ikreymer intended it to actually be the warc_writer object. (This 3rd argument is not tested.)
I'm happy to fix the docs, but I suspect Ilya should weigh in if the warc_writer is really intended to be the 3rd argument. It seems to be that having that would unlock some good functionality. I'm happy to write a test for it. Ilya?
Hello @wumpus,
Thanks for your input. It helped me figure out what was wrong and how to fix it. Reordering function arguments got things working for me. I have submitted a small PR to update README
. Hope it helps.
Example case of filtering responses that don't have
200
status fails with:And the object
RequestRecorder
doesn't havehttp_headers