mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: Fix Headers parsing (#176)
This commit is contained in:
parent
ea20a79825
commit
807736c7aa
2 changed files with 15 additions and 1 deletions
5
.changeset/empty-kiwis-grow.md
Normal file
5
.changeset/empty-kiwis-grow.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hyperdx/app': patch
|
||||
---
|
||||
|
||||
Fix Headers parsing in Log Details
|
||||
|
|
@ -929,7 +929,16 @@ const parseHeaders = (
|
|||
const reqHeaderObj: Dictionary<string | string[] | Dictionary<string>> =
|
||||
pickBy(parsedProperties, (value, key) => key.startsWith(keyPrefix));
|
||||
|
||||
return Object.entries(reqHeaderObj).flatMap(([fullKey, value]) => {
|
||||
return Object.entries(reqHeaderObj).flatMap(([fullKey, _value]) => {
|
||||
let value = _value;
|
||||
try {
|
||||
if (typeof _value === 'string') {
|
||||
value = JSON.parse(_value);
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
// Replacing _ -> - is part of the otel spec, idk why
|
||||
const key = fullKey.replace(keyPrefix, '').replace('_', '-');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue