danieleteti / delphimvcframework

DMVCFramework (for short) is a popular and powerful framework for WEB API in Delphi. Supports RESTful and JSON-RPC WEB APIs development.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request.QueryParams with empty key

llodi-csw opened this issue · comments

If you are making a request with a query string like this:

...?codice

the Request.QueryParams dictionary will be created with only one pair<key,value> both empty.

I think the problem is in TMVCWebRequest.GetQueryParams .
Below you can see the value of FWebRequest related to the example:
image

is this a correct behavior?
IMHO In this example the object Request.QueryParams should be empty because there are no valid parameters (with '=') in the querystring.

Related RFC is not clear about the query string internal format.
Some info here: https://stackoverflow.com/questions/4557387/is-a-url-query-parameter-valid-if-it-has-no-value
However, DMVCFramework should thread
?codice

as if it were

?codice=

So there should be a param codice with an empty value.
I think this is a bug. I'll give a look ASAP