You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No usage headers such as X-RateLimit-Remaining-Videos: 10 for upstream requests.
Expected Behavior
When I do request the api, X-RateLimit-Remaining-Videos: 10 header should be present in upstream request.
Steps To Reproduce
In a docker environment,
When I config a service with response-ratelimiting plugin configued with the below for an echo-api upstream server such as https://postman-echo.com/get,
Before Kong 3.8, it was set by kong.service.request.set_header function so upstream requests contain remaining usage headers.
But in this change, it was replaced by pdk_rl_store_response_header and pdk_rl_apply_response_headers functions those finally manipulates ngx.headerhttps://github.com/Kong/kong/blob/3.8.0/kong/pdk/private/rate_limiting.lua#L7 , that is client response headers, not request headers for upstream.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Kong version (
$ kong version
)Kong 3.8.0.0
Current Behavior
No usage headers such as
X-RateLimit-Remaining-Videos: 10
for upstream requests.Expected Behavior
When I do request the api,
X-RateLimit-Remaining-Videos: 10
header should be present in upstream request.Steps To Reproduce
response-ratelimiting
plugin configued with the below for an echo-api upstream server such ashttps://postman-echo.com/get
,X-RateLimit-Remaining-Videos
header.Anything else?
According to the plugin document page https://docs.konghq.com/hub/kong-inc/response-ratelimiting/#upstream-headers , the plugin should append the usage headers for each limit before proxying it to the upstream service, but it is missing on Kong 3.8
I guess the change in 3c0aa60#diff-e799a72960fa7f956455fff4cca7947749b5c6ecd7cb1e18f220931911eb0bcfR106 caused this behaivior.
Before Kong 3.8, it was set by
kong.service.request.set_header
function so upstream requests containremaining
usage headers.But in this change, it was replaced by
pdk_rl_store_response_header
andpdk_rl_apply_response_headers
functions those finally manipulatesngx.header
https://github.com/Kong/kong/blob/3.8.0/kong/pdk/private/rate_limiting.lua#L7 , that is client response headers, not request headers for upstream.The text was updated successfully, but these errors were encountered: