-
Notifications
You must be signed in to change notification settings - Fork 191
Allow query string parameters without values #636
Conversation
Hi @moozzyk, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! The agreement was validated by .NET Foundation and real humans are currently evaluating your PR. TTYL, DNFBOT; |
LGTM |
/cc @Tratcher |
[InlineData("?q", "q")] | ||
[InlineData("?q&", "q")] | ||
[InlineData("?q1=abc&q2", "q2")] | ||
public void QueryCollection_TEST(string queryString, string emptyParam) |
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.
Test names need work. Component_Scenario
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 bad - forgot to rename.
169312a
to
ca0a77e
Compare
🆙📅 - For the tests I used the same convention as used by the test that already existed. |
{ | ||
var features = new FeatureCollection(); | ||
var request = new HttpRequestFeature(); | ||
request.QueryString = "&&"; |
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.
there should be a leading ?
on here.
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.
I did not put the leading '?' based on https://github.com/aspnet/HttpAbstractions/blob/dev/src/Microsoft.AspNetCore.WebUtilities/QueryHelpers.cs#L126 (and the code that follows this). I don't feel strongly about this so I can add '?' if you prefer to have it.
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.
I will do this:
[Theory]
[InlineData("?&&")]
[InlineData("?&")]
[InlineData("&&")]
|
ca0a77e
to
675df65
Compare
675df65
to
e854d3a
Compare
Addresses #624