//----------------------------------------------------------------------- // // Copyright (c) Andrew Arnott. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOAuth { using System; using System.Collections.Specialized; using System.Linq; using System.Web; /// /// Utility methods for working with URIs. /// internal static class UriUtil { /// /// Tests a URI for the presence of an OAuth payload. /// /// The URI to test. /// True if the URI contains an OAuth message. internal static bool QueryStringContainsOAuthParameters(Uri uri) { if (uri == null) { return false; } NameValueCollection nvc = HttpUtility.ParseQueryString(uri.Query); return nvc.Keys.OfType().Any(key => key.StartsWith(OAuth.Protocol.V10.ParameterPrefix, StringComparison.Ordinal)); } } }