You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
QueryString.Create(IEnumerable<KeyValuePair<string, StringValues>> parameters) doesn't append a key unless it has associated values.
This was unexpected because it means that parsing an incoming query string into an IEnumerable<KeyValuePair<string, StringValues>> and then immediately reconstructing a QueryString results in information loss.
We ran across this after some new middleware attempted to validate parameter values (by treating all query string entries as KeyValuePair<string, StringValues>) and unexpectedly removed a key meant to be read as a switch/flag/indicator in the event no values are supplied.
Is this behavior intentional or defined by a standard?
By the RFC 3986, QueryStrings don't need to have key=value data. So it does seem like a bug, however it is odd that you are using a special flag in the query string. Maybe as a work around, you can just check if the QueryString is empty rather than relying on a special value?
QueryString.Create(IEnumerable<KeyValuePair<string, StringValues>> parameters)
doesn't append a key unless it has associated values.This was unexpected because it means that parsing an incoming query string into an
IEnumerable<KeyValuePair<string, StringValues>>
and then immediately reconstructing aQueryString
results in information loss.We ran across this after some new middleware attempted to validate parameter values (by treating all query string entries as
KeyValuePair<string, StringValues>
) and unexpectedly removed a key meant to be read as a switch/flag/indicator in the event no values are supplied.Is this behavior intentional or defined by a standard?
HttpAbstractions/src/Microsoft.AspNetCore.Http.Abstractions/QueryString.cs
Lines 153 to 175 in 4763337
The text was updated successfully, but these errors were encountered: