-
This is basically same as #869 , when server returns 307/308/301, the {
"Routes": [
{
"UpstreamPathTemplate": "/blah/{everything}",
"UpstreamHttpMethod": [
"HEAD",
"GET",
"POST",
"PUT",
"DELETE",
"OPTIONS"
],
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 80
}
],
"RouteIsCaseSensitive": false,
"DangerousAcceptAnyServerCertificateValidator": true,
"AuthenticationOptions": {
"AuthenticationProviderKey": "Bearer",
"AllowedScopes": []
},
"RateLimitOptions": {
"EnableRateLimiting": true,
"Period": "30s",
"PeriodTimespan": 10,
"Limit": 300
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 30000,
"TimeoutValue": 60000
},
"HttpHandlerOptions": {
"AllowAutoRedirect": true,
"UseCookieContainer": true,
"UseTracing": true,
"MaxConnectionsPerServer": 300
}
},
]
} |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 6 replies
-
Hello, Alexander. |
Beta Was this translation helpful? Give feedback.
-
Yes, exactly the same |
Beta Was this translation helpful? Give feedback.
-
Do you have a solution in mind, and will you open a pull request soon to fix this? |
Beta Was this translation helpful? Give feedback.
-
Sorry, but no. |
Beta Was this translation helpful? Give feedback.
-
I recommended you to define anonymous route, without authentication, and forward everything to downstream service without any custom logic on Ocelot's side. |
Beta Was this translation helpful? Give feedback.
-
Thanks. but as i already said, I overcame this limitation by eliminating redirect. |
Beta Was this translation helpful? Give feedback.
-
But you can't eliminate this redirection because of downstream service behavior... Do you develop downstream service or simply consume it? What are the response headers of the initial response with a 307 status? |
Beta Was this translation helpful? Give feedback.
-
I can't get you!... Do you develop downstream service or consume it? |
Beta Was this translation helpful? Give feedback.
-
In your opinion, what constitutes mature products? Browsers? And do you expect standard browser's behavior in Ocelot, right? Allow me to explain the recognized standard for the 307 status 👇 Quotes from 307 status
Ocelot is not a browser; it merely forwards incoming requests. Ocelot has no custom decision logic, and it should not. Its behavior is based on standards of the HTTP protocol (statuses) and the implemented .NET framework (the
It appears that the reuse of the same HTTP method and body should be a standard behavior of SocketsHttpHandler when the user has enabled the AllowAutoRedirect property. Could you provide concrete proof that this and status 307 behavior is malfunctioning in Ocelot? |
Beta Was this translation helpful? Give feedback.
-
Ocelot Architecture of HTTP RedirectsAs mentioned in Ocelot Configuration doc users can enable/disable the If you search for the AllowAutoRedirect property, it will show the rare processing of the property:
This logic is quite clean (no decision logic at all). However, we might encounter bottlenecks in the response headers logic, so we need to double-check the actual headers the client receives 👉 |
Beta Was this translation helpful? Give feedback.
-
About Authorization headerLet's read these Remarks carefully 👉 The quote:
Do you understand now? |
Beta Was this translation helpful? Give feedback.
-
Reading carefully, I note this:
How does Ocelot support the custom authentication module (
Please tell me, witch one Ocelot implements, and if not, what was the design to support |
Beta Was this translation helpful? Give feedback.
-
Assume, I'm implementing option
|
Beta Was this translation helpful? Give feedback.
As I've already explained you, if auto-redirects is enabled in route configuration then Ocelot delegates behavior to SocketsHttpHandler when the user has enabled the AllowAutoRedirect property.
And Ocelot has no custom auth Delegating Handlers in its pipeline, because Ocelot's "authentication module" is AuthenticationMiddleware which reads
Authorization
header implicitly based on app startup code and auth provider setup.It could be a new Ocelot feature but who will de…