MCPcopy
hub / github.com/sindresorhus/got / clearUnchangedCookieHeader

Method clearUnchangedCookieHeader

source/core/options.ts:2659–2669  ·  view source on GitHub ↗
(previousState: CrossOriginState | undefined, changedState?: Set<string>)

Source from the content-addressed store, hash-verified

2657 }
2658
2659 clearUnchangedCookieHeader(previousState: CrossOriginState | undefined, changedState?: Set<string>): void {
2660 if (
2661 previousState?.hadCookieJar
2662 && this.cookieJar === undefined
2663 && !this.isHeaderExplicitlySet('cookie')
2664 && !changedState?.has('cookie')
2665 && this.headers.cookie === previousState.headers.cookie
2666 ) {
2667 this.deleteInternalHeader('cookie');
2668 }
2669 }
2670
2671 restoreCookieHeader(previousState: CrossOriginState | undefined, headers?: Headers): void {
2672 if (!previousState) {

Callers 4

createFunction · 0.95
_onResponseBaseMethod · 0.95
makeRequestFunction · 0.80

Calls 3

isHeaderExplicitlySetMethod · 0.95
deleteInternalHeaderMethod · 0.95
hasMethod · 0.80

Tested by

no test coverage detected