Beispiel #1
0
        /// <summary>
        /// Ensures that the string is not empty, null, and does not contain any CR|LF chars
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        public static void ValidateToken(string name, string value)
        {
            //if (HttpUtils.IsNullString(value) || HttpUtils.IsEmptryString(value))
            //    throw new ArgumentException(string.Format("The parameter '{0}' cannot be null or empty.", name));

            if (HttpUtils.ContainsCR(value) || HttpUtils.ContainsLF(value))
            {
                throw new ArgumentException(string.Format("The parameter '{0}' cannot contain carrage returns '\\r' or line feed '\\n' characters.", name), name);
            }
        }