MCPcopy Index your code
hub / github.com/codeaashu/claude-code / applyMockHeaders

Function applyMockHeaders

src/services/mockRateLimits.ts:689–709  ·  view source on GitHub ↗
(
  headers: globalThis.Headers,
)

Source from the content-addressed store, hash-verified

687}
688
689export function applyMockHeaders(
690 headers: globalThis.Headers,
691): globalThis.Headers {
692 const mock = getMockHeaders()
693 if (!mock) {
694 return headers
695 }
696
697 // Create a new Headers object with original headers
698 // eslint-disable-next-line eslint-plugin-n/no-unsupported-features/node-builtins
699 const newHeaders = new globalThis.Headers(headers)
700
701 // Apply mock headers (overwriting originals)
702 Object.entries(mock).forEach(([key, value]) => {
703 if (value !== undefined) {
704 newHeaders.set(key, value)
705 }
706 })
707
708 return newHeaders
709}
710
711// Check if we should process rate limits even without subscription
712// This is for Ant employees testing with mocks

Callers 1

processRateLimitHeadersFunction · 0.85

Calls 4

getMockHeadersFunction · 0.85
forEachMethod · 0.80
entriesMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected