Allow whitespaces in entire HTTP header value.
This enables HTTP Basic Authentication.
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4362
add-source --http-header "X-API-Key: 1234"
+ HTTP basic authentication can be achieved by setting the HTTP Basic
+ Authentication header with ``base64(user1:password1)``. Example::
+ add-source --http-header "Authorization: Basic dXNlcjE6cGFzc3dvcmQx"
+
.. option:: --no-checksum
Skips downloading the checksum URL for the rule source.
if len(header) != 2:
return False
name, val = header[0].strip(), header[1].strip()
- if re.match( r"^[\w-]+$", name) and re.match(r"^[\w-]+$", val):
+ if re.match( r"^[\w-]+$", name) and re.match(r"^[\w\s-]+$", val):
return True
return False