-
Notifications
You must be signed in to change notification settings - Fork 1.7k
#1305 Populate RateLimiting headers in the original HttpContext
response accessed via IHttpContextAccessor
#1307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1305 Populate RateLimiting headers in the original HttpContext
response accessed via IHttpContextAccessor
#1307
Conversation
finnaly |
+1 to get this merged. This is stopping me being able to update a project to net6.0 + Ocelot v18 |
This comment was marked as off-topic.
This comment was marked as off-topic.
+1 We need this fix as well |
72da5b1
to
1060ef9
Compare
The feature branch has been rebased onto ThreeMammals:develop! We can start the code review... |
This comment was marked as off-topic.
This comment was marked as off-topic.
@jackletter commented on Oct 24, 2020:
Is this a result of code review (testing)? P.S. Don't write non-English messages please! |
test/Ocelot.UnitTests/RateLimit/ClientRateLimitMiddlewareTests.cs
Outdated
Show resolved
Hide resolved
53fbcd2
to
eaff1d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for Delivery ✅
HttpContext
response using IHttpContextAccessor
HttpContext
response using IHttpContextAccessor
HttpContext
response accessed via IHttpContextAccessor.
HttpContext
response accessed via IHttpContextAccessor.
HttpContext
response accessed via IHttpContextAccessor
Hang in there, Gary! |
Dev Complete and reviewer is offline
…Context` response accessed via `IHttpContextAccessor` (ThreeMammals#1307) * set rate limiting headers on the proper httpcontext * fix Retry-After header * merge fix * refactor of ClientRateLimitTests * merge fix * Fix build after rebasing * EOL: test/Ocelot.AcceptanceTests/Steps.cs * Add `RateLimitingSteps` * code review by @raman-m * Inject IHttpContextAccessor, not IServiceProvider * Ocelot's rate-limiting headers have become legacy * Headers definition life hack * A good StackOverflow link --------- Co-authored-by: Jolanta Łukawska <jolanta.lukawska@outlook.com> Co-authored-by: Raman Maksimchuk <dotnet044@gmail.com>
Fixes #1305
"DisableRateLimitHeaders": false
is not showingX-Rate-Limit
andRetry-After
headers in response #1305Proposed Changes
HttpContext
and not the original one that is returned with a response. The fix is that the rate limiting headers are set for the originalHttpContext
returned byHttpContextAccessor
.