Handle headers containing shebang and encoding declaration