From 04a4d7e58c6b24c255f147849055974cf9bc8e85 Mon Sep 17 00:00:00 2001 From: Shekhar Vaidya Date: Mon, 15 Jun 2026 21:50:12 +0530 Subject: [PATCH] debug: log cookie count in jar before proxy request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- backend/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/main.go b/backend/main.go index 775fc5e..a71a124 100644 --- a/backend/main.go +++ b/backend/main.go @@ -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")