debug: log cookie count in jar before proxy request

Temporary diagnostic — tells us whether Set-Cookie headers from
Microsoft are actually reaching the backend through the CF Worker.
If count is 0, the Worker is stripping them or MS sets cookies via JS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Shekhar Vaidya 2026-06-15 21:50:12 +05:30
parent 6f2c02d79b
commit 04a4d7e58c

View file

@ -606,6 +606,11 @@ func fetchDownloadLinksFromMS(productID, skuID string) ([]byte, error) {
jar = &simpleCookieJar{}
}
jar.mu.Lock()
cookieCount := len(jar.cookies)
jar.mu.Unlock()
log.Printf("MS fetch /proxy: session %s has %d cookies in jar\n", sessionID[:8], cookieCount)
proxyQ := url.Values{}
proxyQ.Set("profile", PROFILE)
proxyQ.Set("productEditionId", "undefined")