Skip to content

Fix validation of queries sent via HTTP POST#37213

Merged
boeker merged 5 commits into
masterfrom
boeker/http-post-validation
Jun 16, 2026
Merged

Fix validation of queries sent via HTTP POST#37213
boeker merged 5 commits into
masterfrom
boeker/http-post-validation

Conversation

@boeker

@boeker boeker commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Problem: When validating whether query-profile-only parameters are used in a query, only the HTTP request parameters are checked. This means that, for a query sent via POST, the parameters are never validated.

The SearchHandler class has a requestMapFromRequest method, which parses the data of a HTTP POST request with JSON data. The fields from this data are then merged with the parameters of the HTTP request into a single map and given to a Query object. However, this map is only stored implicitly inside of the query and there is no way to access it directly, which then might have led to checking only the HTTP request parameters.

This adds a getRequestMap method to Query to be able to get the parameters that were actually used when creating the query. This is then used in the validation (which actually happens in two places). Also adds unit tests.

@hmusum Please review. Is it ok to add the method here and just hand out a(n unmodifiable) map?

@boeker boeker requested a review from hmusum June 16, 2026 07:49

@hmusum hmusum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 yes, this looks good to me

@boeker boeker merged commit 53d99b9 into master Jun 16, 2026
3 checks passed
@boeker boeker deleted the boeker/http-post-validation branch June 16, 2026 09:56
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.

2 participants