mirror of
https://github.com/2dust/v2rayN.git
synced 2026-09-27 01:00:39 +03:00
`Utils.ParseQueryString` already unescapes every value, and `BaseFmt.GetQueryDecoded` unescaped it again. A value that still held a valid percent sequence after the first pass decayed on the second: an obfuscation password of `ob%41fs` is exported as `ob%2541fs` and imported back as `obAfs`. Only well-formed sequences are affected, which is why the damage is silent - `100%` and `66%ff` survive untouched. The same function also split each pair on every `=`, and skipped the pair unless exactly two halves came out. RFC 3986 lists `=` among the sub-delimiters a query value may carry, so only the first one separates the key from the value, and `HttpUtility.ParseQueryString` reads a query string the same way. Splitting on all of them discarded a syntactically valid pair: `?ech=AAj+DQAEAAAAAA==` was lost entirely, and so was a `plugin` value in the non-canonical SIP002 spelling, since those are `;` separated `key=value` lists. v2rayN percent-encodes both on export, so its own links were never affected; what changes is that the parser now follows the grammar instead of discarding a pair it cannot split in two. Splitting on the first `=` only, and reading the value the parser already decoded, fixes both. `ParseQueryString` keeps decoding because `ConfigHandler` reads its result directly. `GetQueryDecoded` and `GetQueryValue` are now equivalent; they are left separate to keep this change small, and can be collapsed if you prefer.