Commit a87269be authored by Jérome Perrin's avatar Jérome Perrin

software/caddy/test: prevent tracebacks during tests

In the test output, there are lots of tracebacks like this one:

    "./software/caddy-frontend/test/test.py", line 534, in do_GET
        for header in config.pop('X-Drop-Header', '').split():
    AttributeError: 'NoneType' object has no attribute 'split'

this does not seem to impact the test result, but it makes the result hard to
read.
parent 4b1bc639
......@@ -531,12 +531,12 @@ class TestHandler(BaseHTTPRequestHandler):
timeout = int(config.pop('Timeout', '0'))
compress = int(config.pop('Compress', '0'))
drop_header_list = []
for header in config.pop('X-Drop-Header', '').split():
for header in (config.pop('X-Drop-Header') or '').split():
drop_header_list.append(header)
header_dict = config
else:
drop_header_list = []
for header in self.headers.dict.get('x-drop-header', '').split():
for header in (self.headers.dict.get('x-drop-header') or '').split():
drop_header_list.append(header)
response = None
status_code = 200
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment