recordHttp static method

void recordHttp(
  1. HttpRequestRecord r
)

Buffer r with its credentials masked by TelescopeRedaction, and emit the masked copy on onHttpRecord. Never throws on a malformed body: one that is not JSON is buffered as given.

Implementation

static void recordHttp(HttpRequestRecord r) {
  if (_paused) return;
  final HttpRequestRecord redacted = TelescopeRedaction.redactHttpRecord(r);
  _http.addLast(redacted);
  while (_http.length > _cap) {
    _http.removeFirst();
  }
  _httpStream.add(redacted);
}