From 502d1dd59a36db22d9a63b781372a1b0b21c5abd Mon Sep 17 00:00:00 2001 From: ht Date: Sun, 6 Sep 2026 18:21:00 +0300 Subject: [PATCH] cover CORS variation on API responses --- docs/quality/uygulama-durumu.md | 6 ++++++ tests/http-state.test.mjs | 1 + 2 files changed, 7 insertions(+) diff --git a/docs/quality/uygulama-durumu.md b/docs/quality/uygulama-durumu.md index 01b2e70..6c6df02 100644 --- a/docs/quality/uygulama-durumu.md +++ b/docs/quality/uygulama-durumu.md @@ -2046,3 +2046,9 @@ D11 için zorunlu üretim değişkenlerini, staging kontrollerini, kademeli traf Giresun, Kayseri, Akdeniz, Aksaray ve Tepecik senaryolarının sentetik kabul kayıtları için benzersiz İKN, şehir, tarih ve saat biçimlerini koruyan regresyon fixture testi eklendi. Bu test resmi doküman doğrulamasının yerine geçmez; resmi kabul için planlanan beş doküman hâlâ gereklidir. Doğrulama: 289 test geçti, üretim derlemesi başarılı. + +### 2026-09-06 · Normal yanıt CORS ayrımı testi + +Allowlistesi etkin HTTP testinde yalnız preflight değil, kimliksiz normal API yanıtı da `Vary: Origin` başlığıyla doğrulanıyor; origin’e göre değişen yanıtların tamamında önbellek ayrımı güvence altında. + +Doğrulama: HTTP testleri 19/19, toplam 289 test geçti; üretim derlemesi başarılı. diff --git a/tests/http-state.test.mjs b/tests/http-state.test.mjs index b5fc61e..6e62422 100644 --- a/tests/http-state.test.mjs +++ b/tests/http-state.test.mjs @@ -37,6 +37,7 @@ test('HTTP preparation requires auth, persists draft and rejects stale revisions assert.equal(unauthorized.status,401); assert.equal(unauthorized.headers.get('x-content-type-options'),'nosniff'); assert.equal(unauthorized.headers.get('referrer-policy'),'no-referrer'); + assert.equal(unauthorized.headers.get('vary'),'Origin'); const draft={firma:{firmaUnvan:'QA Laboratuvar'},priceSchema:1,pricesBySource:{kit1:'12.50'},gecerlilikGun:'120',checks:{products:{kit1:{product:'Test kit',status:'suitable',source:'Teknik 3.2'}},documents:{doc1:{status:'verified',evidence:'Test v1'}}},manualDocuments:[{document:'Yetki',note:'7.1',mandatory:true}],analysisSource:{itemsAndSpecs:[{name:'Kit',quantity:'2 adet'}],documentChecklist:[]}}; const data={key:'2026/1582991',patch:{takipte:true,gorev:{kontrolListesi:[]},bidDraft:draft,checklist:[{key:'collect-documents',sourceSnapshot:'source-v1',done:true}]},snapshot:{id:'ilan-qa',ikn:'2026/1582991'},version:0}; assert.equal((await request('/api/me/tender-state','PUT',data)).status,200);