changed upstream http method to use httpmethod class in .net

This commit is contained in:
Tom Gardham-Pallister
2017-02-07 18:30:21 +00:00
parent bbb808eb51
commit 33ce162693
17 changed files with 105 additions and 21 deletions

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using Ocelot.Values;
namespace Ocelot.Configuration
@ -25,7 +26,7 @@ namespace Ocelot.Configuration
DownstreamPort = downstreamPort;
DownstreamPathTemplate = downstreamPathTemplate;
UpstreamTemplate = upstreamTemplate;
UpstreamHttpMethod = upstreamHttpMethod;
UpstreamHttpMethod = new HttpMethod(upstreamHttpMethod);
UpstreamTemplatePattern = upstreamTemplatePattern;
IsAuthenticated = isAuthenticated;
AuthenticationOptions = authenticationOptions;
@ -47,7 +48,7 @@ namespace Ocelot.Configuration
public PathTemplate DownstreamPathTemplate { get; private set; }
public PathTemplate UpstreamTemplate { get; private set; }
public string UpstreamTemplatePattern { get; private set; }
public string UpstreamHttpMethod { get; private set; }
public HttpMethod UpstreamHttpMethod { get; private set; }
public bool IsAuthenticated { get; private set; }
public bool IsAuthorised { get; private set; }
public AuthenticationOptions AuthenticationOptions { get; private set; }

View File

@ -26,7 +26,7 @@ namespace Ocelot.DownstreamRouteFinder.Finder
{
var configuration = await _configProvider.Get();
var applicableReRoutes = configuration.Data.ReRoutes.Where(r => string.Equals(r.UpstreamHttpMethod, upstreamHttpMethod, StringComparison.CurrentCultureIgnoreCase));
var applicableReRoutes = configuration.Data.ReRoutes.Where(r => string.Equals(r.UpstreamHttpMethod.Method, upstreamHttpMethod, StringComparison.CurrentCultureIgnoreCase));
foreach (var reRoute in applicableReRoutes)
{