Long URLs giving error

Hello,

I have a serious issue with long URLs. I have a GRID with many columns and when the user starts filtering using a lot of columns,

the URL gets really long and it’s giving me this error:

Bad Request

Your browser sent a request that this server could not understand.

Size of a request header field exceeds server limit.

This is the URL example

http://www.mysite.com.au/index?StudentsSearch[id]=&StudentsSearch[current_status]=Cancelled&StudentsSearch[referenceName]=Test&StudentsSearch[reference_2]=&StudentsSearch[masterAccountName]=Testing&StudentsSearch[pickupLocationName]=TestStudentsSearch[pickupRegionName]=NSW+Sydney&StudentsSearch[pickup_contact]=&StudentsSearch[pickupDepartmentName]=Warehouse&StudentsSearch[deliveryLocationName]=testing+(NSW)&StudentsSearch[deliveryRegionName]=&StudentsSearch[delivery_contact]=&StudentsSearch[deliveryDepartmentName]=aaatata&StudentsSearch[operationDate]=&StudentsSearch[goodsReady]=&StudentsSearch[orderEta]=&StudentsSearch[order_comments]=+each+evening+---+Test+Cancelled%2C+Previous+Service+name+was+Standard+Job+cancelled+on+06-03-2018+05%3A55%3A22+by+&StudentsSearch[flight_number]=&StudentsSearch[flightdetails]=&StudentsSearch[internal_comments]=aaataatatatatating+-----+6%2F3%2F2018&StudentsSearch[created_via]=

The problem with that is that the filter in the grid keeps adding all the params even if I didn’t search for that filter. Like if I search for username it will add username=“blablabla” + it will add all the other fields that I have on the table with an empty string. How can I remove the empty string from the URL so it would look like this?

http://www.mysite.com.au/index?StudentsSearch%username]=testing

I was able to fix by removing empty params in the yii.gridview.js