It might be related to known Firefox-884693 issue. Based on some research (here and here), and searching through SignalR code, a fix would be to assign Content-Type
before response is sent back. So following files might have to be changed.
// src/Microsoft.AspNet.SignalR.Core/PersistentConnection.cs
private static Task FailResponse(IResponse response, string message, int statusCode = 400)
{
response.StatusCode = statusCode;
// response.ContentType = "text/plain"; // <--- ADD THIS LINE
return response.End(message);
}
// src/Microsoft.AspNet.SignalR.Core/Transports/WebSocketTransport.cs
private Task AcceptWebSocketRequest(Func<IWebSocket, Task> callback)
{
var accept = _context.Environment.Get<Action<IDictionary<string, object>, WebSocketFunc>>(OwinConstants.WebSocketAccept);
if (accept == null)
{
// Bad Request
_context.Response.StatusCode = 400;
// _context.Response.ContentType = "text/plain"; // <--- ADD THIS LINE
return _context.Response.End(Resources.Error_NotWebSocketRequest);
}
Action<IWebSocket> prepareWebSocket = socket => {
_socket = socket;
socket.OnClose = _closed;
socket.OnMessage = _message;
socket.OnError = _error;
};
var handler = new OwinWebSocketHandler(callback, prepareWebSocket, _maxIncomingMessageSize);
accept(null, handler.ProcessRequest);
return TaskAsyncHelper.Empty;
}
This would require submitting bug to open source project, forking, applying changes, testing it, creating pull request etc. which is longer project than I have time right now. If anyone wants to test this theory, thanks.