merged develop

This commit is contained in:
Tom Gardham-Pallister
2016-08-19 20:20:10 +01:00
parent 0421dba1e2
commit c41dd950e0
6 changed files with 39 additions and 34 deletions

View File

@ -8,6 +8,8 @@ using Ocelot.Library.Infrastructure.UrlPathTemplateRepository;
namespace Ocelot.Library.Middleware
{
using System.Net;
public class ProxyMiddleware
{
private readonly RequestDelegate _next;
@ -49,9 +51,10 @@ namespace Ocelot.Library.Middleware
}
}
if (!urlPathMatch.Match)
if (urlPathMatch == null || !urlPathMatch.Match)
{
throw new Exception("BOOOM TING! no match");
context.Response.StatusCode = (int)HttpStatusCode.NotFound;
return;
}
var upstreamHostUrl = _hostUrlRepository.GetBaseUrlMap(urlPathMatch.DownstreamUrlPathTemplate);