mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-17 13:33:22 +08:00
fix code broken after net5.0 upgrade
This commit is contained in:
parent
1c6bfc3314
commit
a9eec31aaf
@ -24,8 +24,8 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
[Fact]
|
||||
public void should_transform_upstream_header()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -65,8 +65,8 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
[Fact]
|
||||
public void should_transform_downstream_header()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -105,8 +105,8 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
[Fact]
|
||||
public void should_fix_issue_190()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -149,8 +149,8 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
[Fact]
|
||||
public void should_fix_issue_205()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -193,8 +193,8 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
[Fact]
|
||||
public void should_fix_issue_417()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -241,8 +241,8 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
[Fact]
|
||||
public void request_should_reuse_cookies_with_cookie_container()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -284,8 +284,8 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
[Fact]
|
||||
public void request_should_have_own_cookies_no_cookie_container()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -327,8 +327,8 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
[Fact]
|
||||
public void issue_474_should_not_put_spaces_in_header()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -364,8 +364,8 @@ namespace Ocelot.AcceptanceTests
|
||||
|
||||
[Fact]
|
||||
public void issue_474_should_put_spaces_in_header()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -413,9 +413,18 @@ namespace Ocelot.AcceptanceTests
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
if (context.Request.Cookies.TryGetValue("test", out var cookieValue) || context.Request.Headers.TryGetValue("Set-Cookie", out var headerValue))
|
||||
if (context.Request.Cookies.TryGetValue("test", out var cookieValue))
|
||||
{
|
||||
if (cookieValue == "0" || headerValue == "test=1; path=/")
|
||||
if (cookieValue == "0")
|
||||
{
|
||||
context.Response.StatusCode = statusCode;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
if (context.Request.Headers.TryGetValue("Set-Cookie", out var headerValue))
|
||||
{
|
||||
if (headerValue == "test=1; path=/")
|
||||
{
|
||||
context.Response.StatusCode = statusCode;
|
||||
return Task.CompletedTask;
|
||||
|
Loading…
x
Reference in New Issue
Block a user