uri_parser: provide function to split query#16695
Merged
miri64 merged 2 commits intoRIOT-OS:masterfrom Aug 4, 2021
Merged
Conversation
benpicco
reviewed
Aug 1, 2021
| * 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, |
Contributor
There was a problem hiding this comment.
Why use a uri_parser_result_t * here when you are only interested in the query element?
This function could be more generic:
Suggested change
| int uri_parser_split_query(const uri_parser_result_t *uri_parsed, | |
| int uri_parser_split_query(const char *query, size_t query_len, |
Member
Author
There was a problem hiding this comment.
Since then I need to also add verification of the query string to this function, which is already done in uri_parser_process_string()
4 tasks
benpicco
reviewed
Aug 3, 2021
benpicco
approved these changes
Aug 4, 2021
Contributor
benpicco
left a comment
There was a problem hiding this comment.
My only concerns were about the API, but you explained those - the code looks good.
Please squash!
8b3c2ad to
4d2a942
Compare
Member
Author
|
Squashed and rebased |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
This provides a function to
uri_parserto split the query part of a given URI parsing result into its components.Testing procedure
tests/unittestswere amended for the new function, somake -C tests/unittests/ tests-uri_parser testshould succeed for a board of choice.
Issues/PRs references
None.