Skip to content

Commit

Permalink
fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
ida613 committed Nov 5, 2024
1 parent eb92123 commit a35319d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/dd-trace/src/opentracing/propagation/text_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ class TextMapPropagator {
let byteCounter = 0

for (const [key, value] of Object.entries(spanContext._baggageItems)) {
let item = `${this._encodeOtelBaggageKey(String(key).trim())}=${encodeURIComponent(String(value).trim())},`
itemCounter += 1
byteCounter += item.length
if (itemCounter > this._config.baggageMaxItems || byteCounter > this._config.baggageMaxBytes) break
baggage += item
const item = `${this._encodeOtelBaggageKey(String(key).trim())}=${encodeURIComponent(String(value).trim())},`
itemCounter += 1
byteCounter += item.length
if (itemCounter > this._config.baggageMaxItems || byteCounter > this._config.baggageMaxBytes) break
baggage += item
}

baggage = baggage.slice(0, baggage.length - 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ describe('TextMapPropagator', () => {
const spanContext = createContext({ baggageItems })

propagator.inject(spanContext, carrier)
// eslint-disable-next-line max-len
expect(carrier.baggage).to.be.equal('%22%2C%3B%5C%28%29%2F%3A%3C%3D%3E%3F%40%5B%5D%7B%7D%F0%9F%90%B6%C3%A9%E6%88%91=%22%2C%3B%5C%F0%9F%90%B6%C3%A9%E6%88%91')
})

Expand Down

0 comments on commit a35319d

Please sign in to comment.