Skip to content

Ignore Empty Uri Query Parameters #1414

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

Merged
merged 1 commit into from
Feb 15, 2020
Merged

Ignore Empty Uri Query Parameters #1414

merged 1 commit into from
Feb 15, 2020

Conversation

Deantwo
Copy link
Contributor

@Deantwo Deantwo commented Jan 24, 2020

Description

A different attempt at fixing #1404 than what was proposed in #1408.
But even this is not a perfect solution, as explained in #1408 (comment) and #1408 (comment).

Someone with more knowhow should probably rewrite the entire ParseQuery(string) method. Or even better find a more standard way of doing it that doesn't require us to maintain the function ourselves.

For a good idea about how the query parsing should handle can be seen in this little article: https://zzzzbov.com/blag/query-string-hell

Purpose

This pull request is a: Bugfix (non-breaking change which fixes an issue)

@Deantwo Deantwo requested a review from alexeyzimarev January 29, 2020 08:09
Copy link
Member

@alexeyzimarev alexeyzimarev left a comment

Choose a reason for hiding this comment

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

Thanks for the PR :)

I have one comment only - what is the motivation to provide an array with one element instead of using just a char as we did before?

@Deantwo
Copy link
Contributor Author

Deantwo commented Jan 29, 2020

what is the motivation to provide an array with one element instead of using just a char as we did before?

The system.string.split method only has one overload with params char[] as parameter. If you want to use any StringSplitOptions options, you have to supply it as a char[] array.

@alexeyzimarev
Copy link
Member

alexeyzimarev commented Jan 29, 2020

I guess we need a test for this failure case too?

@Deantwo
Copy link
Contributor Author

Deantwo commented Jan 29, 2020

I guess we need a test for this failing case too?

As mentioned in #1408 (comment), there are still a few issues that this doesn't solve. But yes it would probably be a good idea to make some test cases based on the examples given in the https://zzzzbov.com/blag/query-string-hell article.

But it might be even better if the ParseQuery(string) method could be replaced with some built-in function or something. But I haven't had time to research that while at work, since fixing open-source bugs isn't all that good with my boss looking over my shoulder. I just find looking through the issues and making at least one bugfix a really good way to learn a new library.

@alexeyzimarev alexeyzimarev merged commit 5ff81a6 into restsharp:master Feb 15, 2020
@Deantwo Deantwo deleted the patch-1 branch February 15, 2020 13:48
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