summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2/OAuth2/OAuthUtilities.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2011-09-18 07:40:02 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2011-09-18 07:40:02 -0700
commitcfe8dac81872ed4ba425864d550d66abcae581d2 (patch)
tree02908354efecbfb74caaf11538f6852148e74a53 /src/DotNetOpenAuth.OAuth2/OAuth2/OAuthUtilities.cs
parentd36e126e7daa6a0d106fa44692e931d489436bbf (diff)
downloadDotNetOpenAuth-cfe8dac81872ed4ba425864d550d66abcae581d2.zip
DotNetOpenAuth-cfe8dac81872ed4ba425864d550d66abcae581d2.tar.gz
DotNetOpenAuth-cfe8dac81872ed4ba425864d550d66abcae581d2.tar.bz2
All product assemblies build without ccrewrite.exe now.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2/OAuth2/OAuthUtilities.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth2/OAuth2/OAuthUtilities.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth.OAuth2/OAuth2/OAuthUtilities.cs b/src/DotNetOpenAuth.OAuth2/OAuth2/OAuthUtilities.cs
index c2b2f5f..1ae3701 100644
--- a/src/DotNetOpenAuth.OAuth2/OAuth2/OAuthUtilities.cs
+++ b/src/DotNetOpenAuth.OAuth2/OAuth2/OAuthUtilities.cs
@@ -81,7 +81,7 @@ namespace DotNetOpenAuth.OAuth2 {
/// <param name="scopes">The scopes to serialize.</param>
/// <returns>A space-delimited list.</returns>
public static string JoinScopes(HashSet<string> scopes) {
- Contract.Requires<ArgumentNullException>(scopes != null);
+ Requires.NotNull(scopes, "scopes");
return string.Join(" ", scopes.ToArray());
}
@@ -91,8 +91,8 @@ namespace DotNetOpenAuth.OAuth2 {
/// <param name="request">The request to authorize.</param>
/// <param name="accessToken">The access token previously obtained from the Authorization Server.</param>
internal static void AuthorizeWithBearerToken(this HttpWebRequest request, string accessToken) {
- Contract.Requires<ArgumentNullException>(request != null);
- Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(accessToken));
+ Requires.NotNull(request, "request");
+ Requires.NotNullOrEmpty(accessToken, "accessToken");
ErrorUtilities.VerifyProtocol(accessToken.All(ch => accessTokenAuthorizationHeaderAllowedCharacters.IndexOf(ch) >= 0), "The access token contains characters that must not appear in the HTTP Authorization header.");
request.Headers[HttpRequestHeader.Authorization] = string.Format(
@@ -108,7 +108,7 @@ namespace DotNetOpenAuth.OAuth2 {
/// <param name="clientIdentifier">The client identifier.</param>
/// <returns>The client information. Never null.</returns>
internal static IConsumerDescription GetClientOrThrow(this IAuthorizationServer authorizationServer, string clientIdentifier) {
- Contract.Requires<ArgumentException>(!String.IsNullOrEmpty(clientIdentifier));
+ Requires.NotNullOrEmpty(clientIdentifier, "clientIdentifier");
Contract.Ensures(Contract.Result<IConsumerDescription>() != null);
try {