title: Header values with commas
body: <p>According to the HTTP specs a header can look like this:</p>
  
  <pre><code>Header-Name=value1,value2,value3,...
  </code></pre>
  
  <p>I try to parse the header values and store them as an array:</p>
  
  <pre><code>array('value1', 'value2', 'value3')
  </code></pre>
  
  <p>so far so good. I can just tokenize the string if a comma appears.</p>
  
  <p><strong>BUT</strong> how should I handle headers like this one:</p>
  
  <pre><code>Expires=Thu, 01 Dec 1994 16:00:00 GMT
  </code></pre>
  
  <p>there's a comma but in the one value the header has. Oh that's easy I thought and figuered out the rule: Only separate by commas when there's <em>no</em> space before and after the comma. This way both examples get parsed correct.</p>
  
  <p><strong>BUT</strong> then I came across a header like this:</p>
  
  <pre><code>Accept-Encding=gzip, deflate
  </code></pre>
  
  <p>and now? Is this one value <code>array('gzip, deflate')</code> or two values <code>array('gzip', 'deflate')</code>? For me they are two separate values but then my rule from the above isn't true anymore.</p>
  
  <p>Is there a list which headers are allowed more than once? So I can check against a blacklist to determine if the comma means a value delimiter or not?</p>