Skip to content

Commit

Permalink
Merge pull request #3 from shenghuang147/fix_percent_encoding
Browse files Browse the repository at this point in the history
chore: decode when changed pinnedCertchainSha256
  • Loading branch information
shenghuang147 authored May 14, 2024
2 parents ab71b4d + 2e41f5a commit 15e277f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions js/plugin_juicity/juicity.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class juicityClass {
neko.listenOnPreferenceChanged(key)
this2._onPreferenceChanged(key, this2.sharedStorage[key])
}

listenOnPreferenceChangedNow("pinnedCertchainSha256")
}

// 保存时调用(混合编辑后的值)
Expand All @@ -174,6 +176,13 @@ class juicityClass {
}

_onPreferenceChanged(key, newValue) {
if (key == "pinnedCertchainSha256") {
try {
this.common.setKV(key, decodeURIComponent(newValue))
} catch (error) {
neko.logError(error.toString());
}
}
}

// Interface
Expand Down Expand Up @@ -216,10 +225,6 @@ class juicityClass {
let args = util.decodeB64Str(b64Str);
let ss = util.decodeB64Str(args.sharedStorage);

if (ss.pinnedCertchainSha256 != "") {
ss.pinnedCertchainSha256 = decodeURIComponent(ss.pinnedCertchainSha256)
}

let configObject = {
"listen": "127.0.0.1:" + args.port,
"server": util.wrapUri(ss.serverAddress, ss.serverPort),
Expand Down

0 comments on commit 15e277f

Please sign in to comment.