Skip to content

Commit

Permalink
Attribute HttpListenerRequest.UserAgent as nullable (#93405)
Browse files Browse the repository at this point in the history
Changed the datatype for HttpListenerRequest.UserAgent to be a nullable
string to match internally and externally expected behaviour.

Fix #93033
  • Loading branch information
TheMaximum authored Oct 13, 2023
1 parent 851c274 commit 9b7c52f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ internal HttpListenerRequest() { }
public System.Net.TransportContext TransportContext { get { throw null; } }
public System.Uri? Url { get { throw null; } }
public System.Uri? UrlReferrer { get { throw null; } }
public string UserAgent { get { throw null; } }
public string? UserAgent { get { throw null; } }
public string UserHostAddress { get { throw null; } }
public string UserHostName { get { throw null; } }
public string[]? UserLanguages { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public NameValueCollection QueryString

private string RequestScheme => IsSecureConnection ? UriScheme.Https : UriScheme.Http;

public string UserAgent => Headers[HttpKnownHeaderNames.UserAgent]!;
public string? UserAgent => Headers[HttpKnownHeaderNames.UserAgent];

public string UserHostAddress => LocalEndPoint!.ToString();

Expand Down

0 comments on commit 9b7c52f

Please sign in to comment.