OK, I cleaned the handling of headers by looking at how HttpFoundation does the extraction of headers from ``$_SERVER``.