Skip to content
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

topdown: Make http.send() caching use full request #2067

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

patrick-east
Copy link
Contributor

Previously it just used a string key with the method and url. This
causes problems if headers or body contents affect the response, and
users were seeing cached responses returned for different requests.

The new version takes into account the entire parameters object that
is provided to the builtin function.

Fixes: #1980

Copy link
Member

@tsandall tsandall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments on the implementation but nothing major. Once those are addressed, we can merge.

topdown/http.go Outdated Show resolved Hide resolved
topdown/http.go Outdated Show resolved Hide resolved
topdown/http_test.go Show resolved Hide resolved
Previously it just used a string key with the method and url. This
causes problems if headers or body contents affect the response, and
users were seeing cached responses returned for different requests.

The new version takes into account the entire parameters object that
is provided to the builtin function.

Fixes: open-policy-agent#1980
Signed-off-by: Patrick East <east.patrick@gmail.com>
Copy link
Member

@tsandall tsandall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tsandall tsandall merged commit 9f20f22 into open-policy-agent:master Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http.send caching should incorporate all params in key
2 participants