-
Notifications
You must be signed in to change notification settings - Fork 158
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
Fixing ArgumentNullException on empty select/expand #621
Conversation
@@ -82,33 +82,19 @@ public class SelectExpandQueryOption | |||
|
|||
// This constructor is intended for unit testing only. | |||
internal SelectExpandQueryOption(string select, string expand, ODataQueryContext context) |
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.
Combined the testing and production constructors. The production constructor was never tested and the logic was not exactly the same.
I don't think the URLs that this allows are "legal" according to the ABNF (search for "$select"). I could be misreading it, or maybe something else you're aware of in the standard overrides it? |
What should the behavior be? Return a 400? An internal server error should still be a bug IMO |
Good point Giuliano, we triaged this today. |
5358306
to
f3443d8
Compare
@corranrogue9 Fixed |
|
||
private static void ValidateNotEmptyOrWhitespace(string rawValue) | ||
{ | ||
if (rawValue != null && string.IsNullOrWhiteSpace(rawValue)) |
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'm actually pretty baffled that there's no existing string.IsWhiteSpace
method. To double check, though, that's what you're trying to do here, right?
Any consideration for removing rawValue != null
since that's already checked by both callers?
Fixes #620