Closed offtherailz closed 5 years ago
Replicate this is not easy. You have to use ajax in a unit test, with a proxy or not and pass some parameter as undefined.
If you use te proxy or not you will have different behaiviours: In one case the parameters with undefined will not appear in the query string, in the other case will appear empty.
We have to avoid this second behavior and always exclude undefined params from the query string (or request, in general)
@offtherailz I see axios not only ignore undefined params but also null params. It only allow params with value and empty string. I am going to fix proxy request to ignore both undefined and null params so that it align with default axios.
No steps for testers, developers only. See link for dev test
Description
Performing ajax (
ajax.js
) requests with undefinedparams
values causes different query strings using or not using proxy. If you use proxy, the params with undefined values will be added to the request this:paramName1=¶mName2
This doesn't happen if the request is performed directly to the server. This is because of this intercept https://github.com/geosolutions-it/MapStore2/blob/master/web/client/libs/ajax.js#L117
Example:
with :
You will have an additional parameter in queryString
...&CQL_FILTER=
(empty). If the request is performed by axios without this intercept ,the undefined value is not used as parameter.In case of Bug (otherwise remove this paragraph)
Browser Affected any
Steps to reproduce