| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 03a81a2 commit fcbbcb7
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | <PropertyGroup> | |
| 4 | 4 | <TargetFramework>net8.0</TargetFramework> | |
| 5 | - <Version>8.0.5.0</Version> | ||
| 5 | + <Version>8.0.6.0</Version> | ||
| 6 | 6 | <Authors>Ivan Shynkarenka</Authors> | |
| 7 | 7 | <Copyright>Copyright (c) 2019-2023 Ivan Shynkarenka</Copyright> | |
| 8 | 8 | <RepositoryUrl>https://github.com/chronoxor/NetCoreServer</RepositoryUrl> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -159,14 +159,7 @@ public bool PerformServerUpgrade(HttpRequest request, HttpResponse response) | |||
| 159 | 159 | ||
| 160 | 160 | if (string.Compare(key, "Connection", StringComparison.OrdinalIgnoreCase) == 0) | |
| 161 | 161 | { | |
| 162 | - var values = value.Split(',').Select(str => str.Trim()).ToArray(); | ||
| 163 | - if ((values.Length == 0) || | ||
| 164 | - ((values.Length == 1) && (string.Compare(values[0], "Upgrade", StringComparison.OrdinalIgnoreCase) != 0)) || | ||
| 165 | - ((values.Length == 2) && !( | ||
| 166 | - ((string.Compare(values[0], "Upgrade", StringComparison.OrdinalIgnoreCase) == 0) && (string.Compare(values[1], "keep-alive", StringComparison.OrdinalIgnoreCase) == 0)) || | ||
| 167 | - ((string.Compare(values[0], "keep-alive", StringComparison.OrdinalIgnoreCase) == 0) && (string.Compare(values[1], "Upgrade", StringComparison.OrdinalIgnoreCase) == 0)) | ||
| 168 | - )) || | ||
| 169 | - (values.Length > 2)) | ||
| 162 | + if ((string.Compare(value, "Upgrade", StringComparison.OrdinalIgnoreCase) != 0) && (string.Compare(value.RemoveWhiteSpace(), "keep-alive,Upgrade", StringComparison.OrdinalIgnoreCase) != 0)) | ||
| 170 | 163 | { | |
| 171 | 164 | error = true; | |
| 172 | 165 | response.MakeErrorResponse(400, "Invalid WebSocket handshaked request: 'Connection' header value must be 'Upgrade' or 'Upgrade, keep-alive'"); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments