title: Add header to requests with Charles
body: <p>I am trying to use Charles (<a href="http://www.charlesproxy.com" rel="nofollow noreferrer">http://www.charlesproxy.com</a>) to add a header to every HTTP request I execute in a browser. The web app I am using is relying on a header to work correctly. I have setup a rewrite rule to add a header like this:
  <a href="https://i.stack.imgur.com/ERak8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ERak8.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/nwz3z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nwz3z.png" alt="enter image description here"></a></p>
  
  <p>Charles error log shows that the request is matched and it says it added the header:</p>
  
  <pre><code>2017/05/24 16:34:04 INFO     com.xk72.charles.tools.rewrite.RewriteFilter          CONNECT https://www.googleapis.com   Testing: Add Header: MY_HEADER:MY_HEADER_VALUE
  2017/05/24 16:34:04 INFO     com.xk72.charles.tools.rewrite.RewriteFilter          CONNECT https://www.googleapis.com   Matched: Add Header: MY_HEADER:MY_HEADER_VALUE  Rewrite: MY_HEADER_VALUE
  </code></pre>
  
  <p>But when I try to open the web app in question in Chrome by typing in a url and when I inspect the traffic in Chrome Dev Tools, I don't see the header and my app doesn't work.
  <a href="https://i.stack.imgur.com/MbnnE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MbnnE.png" alt="enter image description here"></a></p>