Skip to content

Commit 1055adb

Browse files
committed
Use pickleparse which is decent enough for many class based pickle objects
1 parent 07ad307 commit 1055adb

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@
247247
"html-entities": "^2.3.2",
248248
"html-react-parser": "^1.2.4",
249249
"java-object-serialization": "^0.1.1",
250-
"jpickle": "^0.4.1",
251250
"json-bigint": "^1.0.0",
252251
"jsonpath": "^1.1.1",
253252
"lodash": "^4.17.21",
254253
"lz4js": "^0.2.0",
255254
"pako": "^2.1.0",
256255
"php-serialize": "^4.0.2",
256+
"pickleparser": "^0.1.0",
257257
"rawproto": "^0.7.6",
258258
"react": "^18.2.0",
259259
"react-contenteditable": "^3.3.5",

redisinsight/ui/src/utils/formatters/valueFormatters.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Buffer } from 'buffer'
44
import { isUndefined } from 'lodash'
55
import { serialize, unserialize } from 'php-serialize'
66
import { getData } from 'rawproto'
7-
import { loads as loadsPickle } from 'jpickle'
7+
import { Parser } from 'pickleparser'
88
import JSONBigInt from 'json-bigint'
99

1010
import JSONViewer from 'uiSrc/components/json-viewer/JSONViewer'
@@ -108,7 +108,8 @@ const formattingBuffer = (
108108
}
109109
case KeyValueFormat.Pickle: {
110110
try {
111-
const decoded = loadsPickle(bufferToUTF8(reply))
111+
const parser = new Parser();
112+
const decoded = parser.parse(new Uint8Array(reply.data));
112113

113114
if (isUndefined(decoded)) {
114115
return {

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8997,11 +8997,6 @@ jest@^27.5.1:
89978997
import-local "^3.0.2"
89988998
jest-cli "^27.5.1"
89998999

9000-
jpickle@^0.4.1:
9001-
version "0.4.1"
9002-
resolved "https://registry.yarnpkg.com/jpickle/-/jpickle-0.4.1.tgz#17eea5d3624cccec38f86e89a059abd05952364a"
9003-
integrity sha512-XHSTQUtl/Yv2cNzeQ7NKFuK0Z3d1iqQC2iEwV0cu3/dG6PV3DgACEQ3wGagHRDV6MKzypPWwHVSDY8kBWkbfTA==
9004-
90059000
js-base64@^2.4.9:
90069001
version "2.6.4"
90079002
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4"
@@ -11044,6 +11039,11 @@ php-serialize@^4.0.2:
1104411039
resolved "https://registry.yarnpkg.com/php-serialize/-/php-serialize-4.0.2.tgz#869bd4e01c2d26ac41c1d3e8058ab00ec072e3e5"
1104511040
integrity sha512-73K9MqCnRn07sXxOht6kVLg+fg1lf/VYpecKy4n9ABcw1PJIAWfaxuQKML27EjolGHWxlXTy3rfh59AGrcUvIA==
1104611041

11042+
pickleparser@^0.1.0:
11043+
version "0.1.0"
11044+
resolved "https://registry.yarnpkg.com/pickleparser/-/pickleparser-0.1.0.tgz#ea637e0c077c42bf41fe98f3608d633aeeaed2c6"
11045+
integrity sha512-L81sYaXj6JlEOtVPwhXsEjlDQ0fjxPGf9ay4uBfQnsrR87mZ8SFQR/OD8kdqjQdeyMFcWyCMhx7WKZT1yZK7FQ==
11046+
1104711047
picocolors@^1.0.0:
1104811048
version "1.0.0"
1104911049
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"

0 commit comments

Comments
 (0)