From 485391792452affe56eefb1accf5165815c896f2 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 8 May 2017 12:34:53 -0400 Subject: [PATCH] IHttpContextAccessor registration missing --- src/Billing/Controllers/StripeController.cs | 2 +- src/Billing/Startup.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Billing/Controllers/StripeController.cs b/src/Billing/Controllers/StripeController.cs index da3705098b..90dd60e08b 100644 --- a/src/Billing/Controllers/StripeController.cs +++ b/src/Billing/Controllers/StripeController.cs @@ -33,7 +33,7 @@ namespace Bit.Billing.Controllers return new BadRequestResult(); } - var parsedEvent = StripeEventUtility.ParseEventDataItem(body) as StripeEvent; + var parsedEvent = StripeEventUtility.ParseEventDataItem(body); if(string.IsNullOrWhiteSpace(parsedEvent?.Id)) { return new BadRequestResult(); diff --git a/src/Billing/Startup.cs b/src/Billing/Startup.cs index c7cbfa4185..312a422142 100644 --- a/src/Billing/Startup.cs +++ b/src/Billing/Startup.cs @@ -8,6 +8,8 @@ using Bit.Core; using Stripe; using Bit.Core.Utilities; using Serilog.Events; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection.Extensions; namespace Bit.Billing { @@ -44,6 +46,8 @@ namespace Bit.Billing services.AddBaseServices(); services.AddDefaultServices(); + services.TryAddSingleton(); + // Mvc services.AddMvc(); } @@ -60,6 +64,11 @@ namespace Bit.Billing .AddConsole() .AddDebug(); + if(env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + app.UseMvc(); } }