bneradt commented on code in PR #12742:
URL: https://github.com/apache/trafficserver/pull/12742#discussion_r2604721159
##########
plugins/xdebug/xdebug_headers.cc:
##########
@@ -38,109 +38,6 @@ namespace
DbgCtl dbg_ctl_hdrs{DEBUG_TAG_LOG_HEADERS};
}
-class EscapeCharForJson
-{
-public:
- EscapeCharForJson(bool full_json) : _full_json(full_json) {}
-
- std::string_view
- operator()(char const &c)
- {
- if ((_state != IN_VALUE) && ((' ' == c) || ('\t' == c))) {
- return {""};
- }
- if ((IN_NAME == _state) && (':' == c)) {
- _state = BEFORE_VALUE;
- if (_full_json) {
- return {R"(":")"};
- } else {
- return {"' : '"};
- }
- }
- if ('\r' == c) {
- return {""};
- }
- if ('\n' == c) {
- std::string_view result{_after_value(_full_json)};
-
- if (BEFORE_NAME == _state) {
- return {""};
- } else if (BEFORE_VALUE == _state) {
- // The header field has no value.
- result = _handle_empty_value(_full_json);
- }
- _state = BEFORE_NAME;
- return result;
- }
- if (BEFORE_NAME == _state) {
- _state = IN_NAME;
- } else if (BEFORE_VALUE == _state) {
- _state = IN_VALUE;
- }
- switch (c) {
- case '\'':
- return {"\\\'"};
Review Comment:
This is not in the new switch (see the xdebug_escape.cc version).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]