Ensure headers["Content-Type"] exists before comparing string.