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

Disable query string in key #319

Merged
merged 5 commits into from
Mar 9, 2023
Merged

Disable query string in key #319

merged 5 commits into from
Mar 9, 2023

Conversation

frederichoule
Copy link
Contributor

Adds the parameter "disable_query", which disable the use of query string in cache key name.

@darkweak
Copy link
Owner

darkweak commented Mar 9, 2023

Missing plugins/souin/agnostic/configuration_parser.go and plugins/kratos/configuration.go update too.

@frederichoule
Copy link
Contributor Author

Will do soon in a few minutes.

@frederichoule
Copy link
Contributor Author

I am not using these plugins so won't be able to test them - but it's pretty straightforward.

@darkweak
Copy link
Owner

darkweak commented Mar 9, 2023

In the context/key_test.go L64-65

	if req.Context().Value(Key).(string) != "GET-http-domain.com--with_the_hash" {
		t.Errorf("The Key context must be equal to GET-http-domain.com--with_the_hash, %s given.", req.Context().Value(Key).(string))

In the context/types_test.go L39

	req := httptest.NewRequest(http.MethodGet, "http://domain.com/", nil)

thank you so much for your contribution.

@frederichoule
Copy link
Contributor Author

Ok, I'll also be adding a test for the new disable_query parameter.

@frederichoule
Copy link
Contributor Author

Let me know if that works.

@darkweak
Copy link
Owner

darkweak commented Mar 9, 2023

LGTM, thanks @frederichoule ! 🚀

@darkweak darkweak merged commit 7862e9d into darkweak:master Mar 9, 2023
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.

None yet

2 participants