title: Refactor this code to not place tainted, user-controlled data in the header
body: <p>I'm trying to add custom header in my HTTPHeader like below</p>
  
  <pre><code>Enumeration&lt;String&gt; headerNames = request.getHeaderNames();
  while (headerNames.hasMoreElements()) {
      String headerName = headerNames.nextElement();
      if (headerName.equalsIgnoreCase("SampleHeader"){
          headers.add(headerName, request.getHeader(headerName));
      }
  }
  </code></pre>
  
  <p>but I'm getting below bug while running sonar.</p>
  
  <p>"Refactor this code to not place tainted, user-controlled data in the header."</p>
  
  <p>I think adding a regex might solve my problem, but I had two problems.</p>
  
  <ol>
  <li>I'm need to write an regex that allow alphabets, number and . , ! - _  But I'm unable to create one.</li>
  <li>I'm not sure checking using some regex will debinately solve my problem.</li>
  </ol>