mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: fixing use of new c# in 2020 (#3507)
* fix: fixing use of new c# in 2020 * fixing doc comment
This commit is contained in:
parent
176a2d3b66
commit
bd66be3d1c
@ -111,7 +111,6 @@ public override string ToString()
|
||||
/// Gets the address based on the <see cref="request"/> and RemoteEndPoint
|
||||
/// <para>Called after ServerHandShake is accepted</para>
|
||||
/// </summary>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
internal string CalculateAddress()
|
||||
{
|
||||
if (request.Headers.TryGetValue("X-Forwarded-For", out string forwardFor))
|
||||
|
@ -10,6 +10,7 @@ namespace Mirror.SimpleWeb
|
||||
public class Request
|
||||
{
|
||||
private static readonly char[] lineSplitChars = new char[] { '\r', '\n' };
|
||||
private static readonly char[] headerSplitChars = new char[] { ':' };
|
||||
public string RequestLine;
|
||||
public Dictionary<string, string> Headers = new Dictionary<string, string>();
|
||||
|
||||
@ -18,7 +19,7 @@ public Request(string message)
|
||||
string[] all = message.Split(lineSplitChars, StringSplitOptions.RemoveEmptyEntries);
|
||||
RequestLine = all.First();
|
||||
Headers = all.Skip(1)
|
||||
.Select(header => header.Split(':', 2, StringSplitOptions.RemoveEmptyEntries))
|
||||
.Select(header => header.Split(headerSplitChars, 2, StringSplitOptions.RemoveEmptyEntries))
|
||||
.ToDictionary(split => split[0].Trim(), split => split[1].Trim());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user