-
Notifications
You must be signed in to change notification settings - Fork 2.1k
uri_parser: provide function to split query #16695
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
Conversation
* In that case, the array is filled with the first @p params_len | ||
* name-value-pairs in uri_parser_result_t::query of @p uri_parsed. | ||
*/ | ||
int uri_parser_split_query(const uri_parser_result_t *uri_parsed, |
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.
Why use a uri_parser_result_t *
here when you are only interested in the query
element?
This function could be more generic:
int uri_parser_split_query(const uri_parser_result_t *uri_parsed, | |
int uri_parser_split_query(const char *query, size_t query_len, |
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.
Since then I need to also add verification of the query string to this function, which is already done in uri_parser_process_string()
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.
My only concerns were about the API, but you explained those - the code looks good.
Please squash!
8b3c2ad
to
4d2a942
Compare
Squashed and rebased |
Contribution description
This provides a function to
uri_parser
to split the query part of a given URI parsing result into its components.Testing procedure
tests/unittests
were amended for the new function, somake -C tests/unittests/ tests-uri_parser test
should succeed for a board of choice.
Issues/PRs references
None.