Solution you did is wrong, as such capability already exists and it is just matter of configuration.
see wildfly/wildfly-undertow_2_0.xsd at master · wildfly/wildfly · GitHub for shema reference.
in short just add allow-equals-in-cookie-value="true" to http-listener configuration or any other for that you need it for.
Sorry, I had already tried setting that parameter under undertow subsystem, still the code is throwing the same exception. The parsing code is not capable of parsing the cookie value as json string, hence I have added that code.
Note: = is in json string object.
This has been fixed under: https://github.com/undertow-io/undertow/commit/fd612a3d3ddc4303ee3687c0c1ac3c5e3bd1a47e
If JSON object has '=' inside the object, then we need to add allow-equals-in-cookie-value="true".