Fix crash when User-Agent header is missing.