consolle 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/Gemfile.lock +1 -1
- data/lib/consolle/server/console_supervisor.rb +22 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c6409b2de73d4612f586ccb5ebf8bcfbf791b1b8f54ce385ff803496dea45a03
|
|
4
|
+
data.tar.gz: 446a7bfe92350892d29b10d9cdc16c83f4e1d77e1adf680b3274f793d3cc51b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0892cc7e9268d58ed4152a404e1901099dc0652993f01c00937e15180c3fd45ef95f0d6a0d001af0d319f6df02904e201b4266e7df96de92955af2e0475c51fa'
|
|
7
|
+
data.tar.gz: cae1d830feb7101bb50b598b41474a9216c216485b4a036af25d64dc31e9cb8880f9725c0ca2c500807cf16e866a08328ed52e7ff366a46cdd55fcb00078ae15
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.8
|
data/Gemfile.lock
CHANGED
|
@@ -72,11 +72,31 @@ module Consolle
|
|
|
72
72
|
|
|
73
73
|
# Encode code using Base64 to handle special characters and remote consoles
|
|
74
74
|
# Ensure UTF-8 encoding to handle strings that may be tagged as ASCII-8BIT
|
|
75
|
-
utf8_code = code.encoding == Encoding::UTF_8
|
|
75
|
+
utf8_code = if code.encoding == Encoding::UTF_8
|
|
76
|
+
code
|
|
77
|
+
else
|
|
78
|
+
# Try to handle ASCII-8BIT strings that might contain UTF-8 data
|
|
79
|
+
temp = code.dup
|
|
80
|
+
if code.encoding == Encoding::ASCII_8BIT
|
|
81
|
+
# First try to interpret as UTF-8
|
|
82
|
+
temp.force_encoding('UTF-8')
|
|
83
|
+
if temp.valid_encoding?
|
|
84
|
+
temp
|
|
85
|
+
else
|
|
86
|
+
# If not valid UTF-8, try other common encodings
|
|
87
|
+
# or use replacement characters
|
|
88
|
+
code.encode('UTF-8', invalid: :replace, undef: :replace)
|
|
89
|
+
end
|
|
90
|
+
else
|
|
91
|
+
# For other encodings, convert to UTF-8
|
|
92
|
+
code.encode('UTF-8')
|
|
93
|
+
end
|
|
94
|
+
end
|
|
76
95
|
encoded_code = Base64.strict_encode64(utf8_code)
|
|
77
96
|
|
|
78
97
|
# Use eval to execute the Base64-decoded code
|
|
79
|
-
|
|
98
|
+
# Ensure decoded string is properly handled as UTF-8
|
|
99
|
+
eval_command = "eval(Base64.decode64('#{encoded_code}').force_encoding('UTF-8'), IRB.CurrentContext.workspace.binding)"
|
|
80
100
|
logger.debug '[ConsoleSupervisor] Sending eval command (Base64 encoded)'
|
|
81
101
|
@writer.puts eval_command
|
|
82
102
|
@writer.flush
|