From e03538bdc89066a3831a45e862f45dab790b62f5 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 20 Dec 2017 16:13:02 +0900 Subject: [PATCH] [Modify] Add it --- websocket-sharp/Ext.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index 9b0d7594..b768d523 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -1022,6 +1022,15 @@ namespace WebSocketSharp : value.Substring (start + 1, len).Replace ("\\\"", "\""); } + internal static bool Upgrades ( + this NameValueCollection headers, string protocol + ) + { + var comparison = StringComparison.OrdinalIgnoreCase; + return headers.Contains ("Upgrade", protocol, comparison) + && headers.Contains ("Connection", "Upgrade", comparison); + } + internal static string UTF8Decode (this byte[] bytes) { try {