forked from tbnobody/OpenDTU
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: sanitize battery manufacturer name string
If the string contains control characters for some reason, the browser will reject the json with the error `bad control character in string literal`. This adds a setManufacturer function that validates the string is ASCII and will cut off the string at the first non-ascii character. Pylontech: `PYLON` (50 59 4C 4F 4E 20 20 20) Pytes: `PYTES` (50 59 54 45 53) Deye: `DY001` (44 59 30 30 31 03 E8 03) See #1226 (comment)
- Loading branch information
1 parent
cec4003
commit 1af5a2c
Showing
4 changed files
with
22 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters