mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
fix warnings
This commit is contained in:
@ -9,6 +9,7 @@ using System.Linq;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Bit.Api.Utilities;
|
||||
using Bit.Core.Utilities;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
@ -19,14 +20,14 @@ namespace Bit.Api.Controllers
|
||||
{
|
||||
private readonly IPushRegistrationService _pushRegistrationService;
|
||||
private readonly IPushNotificationService _pushNotificationService;
|
||||
private readonly IHostingEnvironment _environment;
|
||||
private readonly IWebHostEnvironment _environment;
|
||||
private readonly CurrentContext _currentContext;
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
|
||||
public PushController(
|
||||
IPushRegistrationService pushRegistrationService,
|
||||
IPushNotificationService pushNotificationService,
|
||||
IHostingEnvironment environment,
|
||||
IWebHostEnvironment environment,
|
||||
CurrentContext currentContext,
|
||||
GlobalSettings globalSettings)
|
||||
{
|
||||
|
@ -9,6 +9,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Stripe;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Bit.Api.Utilities
|
||||
{
|
||||
@ -113,7 +114,7 @@ namespace Bit.Api.Utilities
|
||||
else
|
||||
{
|
||||
var errorModel = internalErrorModel ?? new InternalApi.ErrorResponseModel(errorMessage);
|
||||
var env = context.HttpContext.RequestServices.GetRequiredService<IHostingEnvironment>();
|
||||
var env = context.HttpContext.RequestServices.GetRequiredService<IWebHostEnvironment>();
|
||||
if(env.IsDevelopment())
|
||||
{
|
||||
errorModel.ExceptionMessage = exception.Message;
|
||||
|
Reference in New Issue
Block a user