Closed singhashmeet closed 1 year ago
Hey there, I didn't encounter this use-case before but it's definitely a nice addition. Thanks for submitting the PR 👍
Just fyi, I added a patch in https://github.com/lorenzodonini/ocpp-go/pull/174 to fix an issue with trailing newlines.
Currently the standard library "encoding/json" is being used to send messages. The library by default escapes a string as mentioned here https://pkg.go.dev/encoding/json#HTMLEscape While sending a URL to the charger or any other string that has symbols like
&
in them they are escaped and the chargers are not able to parse them correctly. For example if you send a firmware update with a URL likehttps://someUri?param1=123¶m2=7363&something=else
It is escaped tohttps://someUri?param1=123\u0026param2=7363\u0026something=else
which the charger will not be able to download and the update fails.This change adds a flag and implements a custom jsonMarshal method to provide additional functionality for handling issues like this