It seems that for some headers (especially for headers generated by the NGINX itself) the lowcase_key is not set and points to a garbage pointer. Is there a way to ensure if lowcase_key exists?