Commit Graph

18 Commits (c79d4bad0bdcd2ab6665d87eb184c83be47ed03e)

Author SHA1 Message Date
Kyle Larose dfea8a1624
handle invalid characeters in encoding
When establishing a connection to an SSH server, WebSSH tries to guess
at its encoding using a command sent prior to opening the terminal.
Unfortunately, sometimes this can return data which does not form proper
input for the `encode` function used by `is_valid_encoding` to test
whether the encoding is known.

In particular, we ran in to a case where the server was returning a
string which had a \0 in it when converted to ascii. That raised a
`ValueError` (as opposed to `LookupError`), which was uncaught.

Handle the `ValueError` case as well, treating it as an unknown encoding
so that we fall back on the default.
2023-03-30 10:52:53 -04:00
Sheng fc30ead69e Refactoring 2019-10-09 11:40:07 +08:00
Sheng afcf8b52cc Validate the result of locale charmap 2019-10-05 13:18:53 +08:00
Sheng 7f6db649bf Support link scope ipv6 address 2019-09-19 10:55:34 +08:00
Sheng c35f801235 Support custom origin configuration 2019-01-19 16:46:25 +08:00
Sheng 682ddbf65f Removed function for detecting whether the http(s) server is open to public 2019-01-15 23:02:14 +08:00
Sheng 2e0f06e650 Fixed is_same_primary_domain 2019-01-11 15:02:30 +08:00
Sheng 5c8bd84b95 Added an option for configuring cross-origin websocket level 2019-01-10 22:09:32 +08:00
Sheng 8e4039a24a Support redirecting http to https 2018-10-21 14:07:44 +08:00
Sheng 40cf1095ff Use open_to_public to store the status of the http(s) server 2018-10-20 17:54:12 +08:00
Sheng c06bf5311a Added an option for blocking public non-https requests 2018-10-17 22:39:53 +08:00
Sheng a51918d2ac Added to_ip_address to utils 2018-10-15 17:20:30 +08:00
Sheng 66ebe2ceb2 Use general method to validate ipaddress 2018-10-13 09:47:15 +08:00
Sheng 88405eddac Added to_int to utils 2018-10-10 08:49:59 +08:00
Sheng 90397715dc Optimized is_valid_hostname 2018-08-21 21:55:57 +08:00
Sheng 37299468a9 Added is_valid_hostname to utils 2018-08-20 21:20:55 +08:00
Sheng e85ae1692e Added to_bytes function to utils 2018-08-20 18:36:04 +08:00
Sheng 1e4ece58c8 Added functions for validating ip and port 2018-08-10 09:23:25 +08:00