fix _isRequestSecure method