Added GetValue (this string, string, bool) method

This commit is contained in:
sta
2014-08-10 21:49:42 +09:00
parent 034e245272
commit aedefc1391
2 changed files with 20 additions and 2 deletions

View File

@@ -522,10 +522,10 @@ namespace WebSocketSharp.Net
foreach (var p in parts) {
var part = p.Trim ();
if (part.StartsWith ("charset", StringComparison.OrdinalIgnoreCase)) {
var charset = part.GetValue ("=");
var charset = part.GetValue ("=", true);
if (charset != null && charset.Length > 0) {
try {
_contentEncoding = Encoding.GetEncoding (charset.Trim ('"'));
_contentEncoding = Encoding.GetEncoding (charset);
}
catch {
_context.ErrorMessage = "Invalid Content-Type header";