1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 09:02:48 -05:00

Turn on file scoped namespaces (#2225)

This commit is contained in:
Justin Baur
2022-08-29 14:53:16 -04:00
committed by GitHub
parent 7c4521e0b4
commit 34fb4cca2a
1206 changed files with 73816 additions and 75022 deletions

View File

@ -4,29 +4,28 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
namespace Bit.Notifications
namespace Bit.Notifications;
[Authorize("Internal")]
public class SendController : Controller
{
[Authorize("Internal")]
public class SendController : Controller
private readonly IHubContext<NotificationsHub> _hubContext;
public SendController(IHubContext<NotificationsHub> hubContext)
{
private readonly IHubContext<NotificationsHub> _hubContext;
_hubContext = hubContext;
}
public SendController(IHubContext<NotificationsHub> hubContext)
[HttpPost("~/send")]
[SelfHosted(SelfHostedOnly = true)]
public async Task PostSend()
{
using (var reader = new StreamReader(Request.Body, Encoding.UTF8))
{
_hubContext = hubContext;
}
[HttpPost("~/send")]
[SelfHosted(SelfHostedOnly = true)]
public async Task PostSend()
{
using (var reader = new StreamReader(Request.Body, Encoding.UTF8))
var notificationJson = await reader.ReadToEndAsync();
if (!string.IsNullOrWhiteSpace(notificationJson))
{
var notificationJson = await reader.ReadToEndAsync();
if (!string.IsNullOrWhiteSpace(notificationJson))
{
await HubHelpers.SendNotificationToHubAsync(notificationJson, _hubContext);
}
await HubHelpers.SendNotificationToHubAsync(notificationJson, _hubContext);
}
}
}