Make if checks in RequestContext.php more concise

Change-Id: Ieb1eaeb595fc77ba926ba6ff96140dff44ba840f