Skip to content

Commit

Permalink
add TODO
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Marantz <[email protected]>
  • Loading branch information
jmarantz committed Sep 4, 2024
1 parent 454c8db commit 62f9f27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/common/json/json_sanitizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "source/common/json/json_internal.h"

#include "absl/strings/str_format.h"
#include "utf8_validity.h"

namespace Envoy {
namespace Json {
Expand Down Expand Up @@ -88,6 +87,12 @@ absl::string_view sanitize(std::string& buffer, absl::string_view str) {
// Note that JSON string escapes are always 4 digit hex. 3 digit octal would
// be more compact, and is legal JavaScript, but not legal JSON. See
// https://www.json.org/json-en.html for details.
//
// TODO(jmarantz): It would better to use the compact JSON escapes for
// quotes, slashes, backspace, form-feed, linefeed, CR, and tab, in which
// case we'd also need to modify jsonEquivalentStrings in
// test/common/json/json_sanitizer_test_util.h. We don't expect to hit this
// often, so it isn't a priority to use these more compact encodings.
buffer.clear();
for (char c : str) {
if (needs_slow_sanitizer[static_cast<uint8_t>(c)]) {
Expand Down

0 comments on commit 62f9f27

Please sign in to comment.