# Potential Bug when filtering by specific request header value

**URL:** <https://discourse.mitmproxy.org/t/potential-bug-when-filtering-by-specific-request-header-value/1296>\
**Category:** Uncategorized\
**Created:** [October 24, 2018, 5:07pm UTC](https://discourse.mitmproxy.org/t/potential-bug-when-filtering-by-specific-request-header-value/1296 "2018-10-24T17:07:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![selenium34](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@selenium34](https://discourse.mitmproxy.org/u/selenium34)\
**Post date:** [October 24, 2018, 5:07pm UTC](https://discourse.mitmproxy.org/t/potential-bug-when-filtering-by-specific-request-header-value/1296/1 "2018-10-24T17:07:56Z")

</div>

I’d like to filter out a specific header (User-Agent which contains parenthesis and spaces), but this is reproducible without those special characters needing escape in regex

##### Steps to reproduce the problem:

1. Launch ‘mitmproxy --mode regular’
2. Presss ‘B’ to launch a browser
3. Navigate to a site
4. Attempt to filter using ~hq

##### Any other comments? What have you tried so far?

If for instance, I were to want to see requests with the common Accept-Header value of ‘deflate, gzip’, I can’t seem to get a working filter value.

“~hq Accept-Header deflate, gzip” or “(~hq Accept-Header deflate, gzip)” or “~hq Accept-Header “deflate, gzip”” I am unable to get the desired results (the same would go for any attempt on a User-Agent which would be more helpful in our use case.

I am able to filter by it having the Header, but not by the specific value. I can get this to work on a header value without a space (i.e. ~hq Host 172.217.10.238)

##### System information

Mac OS (10.13.6) High Sierra

##### mitmproxy --version

Mitmproxy: 4.0.4  
Python: 3.7.0  
OpenSSL: OpenSSL 1.0.2p 14 Aug 2018  
Platform: Darwin-17.7.0-x86\_64-i386-64bit
