Using [NotNull]
This commit is contained in:
parent
208fa4af36
commit
e632831c09
|
|
@ -5,6 +5,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.WebSockets.Protocol
|
||||
{
|
||||
|
|
@ -123,13 +124,8 @@ namespace Microsoft.AspNet.WebSockets.Protocol
|
|||
/// </summary>
|
||||
/// <param name="requestKey"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateResponseKey(string requestKey)
|
||||
public static string CreateResponseKey([NotNull] string requestKey)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(requestKey))
|
||||
{
|
||||
throw new ArgumentNullException("requestKey");
|
||||
}
|
||||
|
||||
using (var algorithm = SHA1.Create())
|
||||
{
|
||||
string merged = requestKey + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
{
|
||||
"version": "1.0.0-*",
|
||||
"description": "Managed web socket protocol parser.",
|
||||
"dependencies": {
|
||||
"Microsoft.Framework.NotNullAttribute.Internal": { "type": "build", "version": "1.0.0-*" }
|
||||
},
|
||||
"frameworks": {
|
||||
"net45": { },
|
||||
"dnxcore50": {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using System.Diagnostics.Contracts;
|
|||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.WebSockets.Protocol.Test
|
||||
{
|
||||
|
|
@ -255,12 +256,8 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
|
|||
return Task.FromResult<object>(null);
|
||||
}
|
||||
|
||||
private static void VerifyBuffer(byte[] buffer, int offset, int count, bool allowEmpty)
|
||||
private static void VerifyBuffer([NotNull] byte[] buffer, int offset, int count, bool allowEmpty)
|
||||
{
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
if (offset < 0 || offset > buffer.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(offset), offset, string.Empty);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.WebSockets.Protocol": "1.0.0-*",
|
||||
"Microsoft.Framework.NotNullAttribute.Internal": { "type": "build", "version": "1.0.0-*" },
|
||||
"xunit.runner.aspnet": "2.0.0-aspnet-*"
|
||||
},
|
||||
"frameworks": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue