Fix secure request detection (refs #4779)