elastic / elastic/apm-agent-nodejs

Refactor filterSensitiveHeaders in lib/filters/http-headers.js

Open
#1,923 1 comment 0 reactions 0 assignees View on GitHub
agent-nodejs performance
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

Re:

```
function filterSensitiveHeaders (headers) {
for (const key in headers) {
```

> Unrelated to this change: Wouldn't it typically be faster to iterate through the set of sensitive headers, rather than iterating through the set of given headers? I say "typically" because my guess is request and response headers generally number greater than 3. Anyway, if you agree, I can open a ticket to consider changing this. Low prio, this is possible premature optimization.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.