Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redux: Scaffolding for custom replace/revive logic.
Be sure to use our SerializeEscaped wrapper, introduced earlier in this series, for proper escaping of the '__serializedType__' key, to prevent a security hole. This code looks almost exactly the same as it would without our wrapper. One key difference is that we use the constant SERIALIZED_TYPE_FIELD_NAME, exposed by our wrapper and used in its implementation, to be certain that we're using the same field name that gets escaped. Fortunately, this is very easy to do. (If we had used a different string, then, as long as that string were consistent between our custom replacer and reviver functions, (1) things would basically work, with no obvious indications that anything was wrong, and (2) the security hole would reopen.)
- Loading branch information