]> git.ipfire.org Git - thirdparty/suricata-update.git/commit
Remove User-Agent header if set to empty 59/head
authorShivani Bhardwaj <shivanib134@gmail.com>
Tue, 6 Nov 2018 16:06:24 +0000 (21:36 +0530)
committerShivani Bhardwaj <shivanib134@gmail.com>
Tue, 6 Nov 2018 16:28:59 +0000 (21:58 +0530)
commit4adeb12793f0f27864eea7f24c392eed94832774
treea0166c544d1013fcd18c1b519ff9e03169df3f13
parent840f69cf033cd3ec43581a797a5c5e7ba25d351f
Remove User-Agent header if set to empty

`suricata-update` sends a User Agent as a part of the request header to
get some basic information about the user system like the suricata-update
version, python version, etc. However, some users do not like this
behavior and are facililated with a `--user-agent` option whereby they
can modify the `User-Agent` header to a custom string. Although, in some
cases, it has been observed that the `User-Agent` header can be set to
nothing. In some other cases, users wish to set it to an empty string.

Example:

```
$ ./bin/suricata-update update-sources --user-agent "  "
```

generates request headers like,

```
Accept-Encoding: identity
Host: XXX
User-Agent:
Connection: close
```

which makes `User-Agent` header quite redundant.

Remove the header if it is set to a string that evaluates to nothing.

Closes Redmine ticket #2665.
suricata/update/net.py