Comment why we set X-Requested-With (#1870)

This commit is contained in:
BrennanConroy 2018-04-05 11:38:15 -07:00 committed by GitHub
parent 11343ea15d
commit b9e88923e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,8 @@ namespace Microsoft.AspNetCore.Http.Connections.Client.Internal
_closeTimeout = httpOptions.CloseTimeout;
}
// Set this header so the server auth middleware will set an Unauthorized instead of Redirect status code
// See: https://github.com/aspnet/Security/blob/ff9f145a8e89c9756ea12ff10c6d47f2f7eb345f/src/Microsoft.AspNetCore.Authentication.Cookies/Events/CookieAuthenticationEvents.cs#L42
_webSocket.Options.SetRequestHeader("X-Requested-With", "XMLHttpRequest");
_logger = (loggerFactory ?? NullLoggerFactory.Instance).CreateLogger<WebSocketsTransport>();