Please don't call this method twice, save result to local variable. There's also trick `if (const char *acceptEncoding = request->getAcceptEncoding()) {...}`.