// send a real request from your browser · inspect CORS headers · debug preflight
REQUEST
CUSTOM HEADERS
REQUEST BODY
CORS ANALYSIS
RESPONSE HEADERS
RESPONSE BODY
About the CORS Tester
CORS Test Aracı Hakkında
This tool sends test requests (with optional preflight OPTIONS) against any URL from your chosen Origin and displays the response headers. It tells you exactly what the server is returning, what Access-Control-* headers it's setting, and whether the browser would allow the actual cross-origin request based on the response.
CORS is a browser-enforced security boundary; this tool replicates the relevant header exchange so you can debug without writing a one-off test page. You can vary the method (GET/POST/PUT/DELETE), the headers (Authorization, Content-Type, custom), and the credentials mode, then observe how the server responds to each combination.
Useful for: confirming a CORS configuration before client-side integration, diagnosing why a request that works in curl fails in the browser, and identifying which specific header or method the server's allow-list is missing.
Bu araç, seçtiğiniz Origin'den herhangi bir URL'ye test istekleri (isteğe bağlı preflight OPTIONS ile) gönderir ve yanıt header'larını gösterir. Sunucunun tam olarak ne döndürdüğünü, hangi Access-Control-* header'larını set ettiğini ve tarayıcının yanıta göre gerçek cross-origin isteğine izin verip vermeyeceğini söyler.
CORS tarayıcı tarafından zorlanan güvenlik sınırıdır; bu araç ilgili header alışverişini yeniden üretir; böylece tek seferlik test sayfası yazmadan debug yapabilirsiniz. Method'u (GET/POST/PUT/DELETE), header'ları (Authorization, Content-Type, custom) ve credentials modunu değiştirip sunucunun her kombinasyona nasıl yanıt verdiğini gözlemleyebilirsiniz.
Şunlar için faydalı: client tarafı entegrasyon öncesi CORS yapılandırmasını doğrulamak, curl'de çalışan isteğin tarayıcıda neden başarısız olduğunu teşhis etmek ve sunucunun allow-list'inden hangi spesifik header veya method'un eksik olduğunu bulmak.
Common CORS failures
Yaygın CORS hataları
JSON POST blocked. A POST with Content-Type: application/json triggers a preflight; if the server doesn't allow Content-Type in Access-Control-Allow-Headers, the preflight fails and the actual request never runs.
Credentials with wildcard origin. Sending credentials: 'include' from the browser requires the server to echo the specific origin, not '*', and to send Access-Control-Allow-Credentials: true. Many configurations get one of these wrong.
Preflight 4xx. Auth middleware rejecting unauthenticated OPTIONS is the most common cause. OPTIONS preflights are unauthenticated by spec — exempt them from auth.
JSON POST engellenmiş. Content-Type: application/json ile POST preflight tetikler; sunucu Access-Control-Allow-Headers'ta Content-Type'a izin vermiyorsa preflight başarısız olur ve asıl istek hiç çalışmaz.
Credentials ile wildcard origin. Tarayıcıdan credentials: 'include' göndermek sunucunun '*' değil spesifik origin'i echo etmesini ve Access-Control-Allow-Credentials: true göndermesini gerektirir. Birçok yapılandırma birini yanlış yapar.
Preflight 4xx. Auth middleware'in kimliği doğrulanmamış OPTIONS'u reddetmesi en yaygın sebep. OPTIONS preflight'lar spec gereği kimlik doğrulamasızdır — auth'tan muaf tutun.
CORS mistakes to avoid
Kaçınılacak CORS hataları
Wildcard origin in production. Echo specific origins from a server-side allow-list.
Forgetting CORS on error responses. 4xx/5xx responses also need CORS headers, or the browser can't read the body.
Disabling CORS via browser extension. Hides the real bug; will bite users.
Mixing up Access-Control-Allow-Headers case. Header names are case-insensitive but list them as the spec defines them for safety.
Üretimde wildcard origin. Sunucu tarafı allow-list'ten spesifik origin'leri echo edin.
Hata yanıtlarında CORS unutmak. 4xx/5xx yanıtlarının da CORS header'ları olmalı; yoksa tarayıcı body'yi okuyamaz.
CORS'u tarayıcı eklentisiyle kapatmak. Gerçek bug'ı gizler; kullanıcıyı vurur.
Access-Control-Allow-Headers büyük/küçük harf karışıklığı. Header isimleri case-insensitive ama güvenli olması için spec'in tanımladığı gibi listeleyin.
Frequently asked questions
Sık sorulan sorular
What triggers a preflight OPTIONS?
Methods other than GET/HEAD/POST, Content-Type other than form-urlencoded / multipart / text/plain (so all JSON POSTs), or any custom header. Authorization counts as custom.
Why does curl work but the browser fail?
curl doesn't enforce CORS. The browser does, on behalf of the user. The problem is purely in the response headers (or lack of them).
Can I 'disable' CORS server-side?
You can widen what you allow (specific origins, methods, headers, credentials). You cannot remove the browser's check; only the response can be made permissive.
How long can I cache preflight responses?
Use Access-Control-Max-Age (seconds). 600 (10 min) is a reasonable default; browsers cap actual values at their own limits (commonly 24h).
Does CORS apply to same-origin requests?
No — CORS only applies when the request's origin differs from the response's origin. Same-origin requests skip the check entirely.
Preflight OPTIONS'u ne tetikler?
GET/HEAD/POST dışı method'lar, form-urlencoded / multipart / text/plain dışı Content-Type (yani tüm JSON POST'lar) veya herhangi bir custom header. Authorization custom sayılır.
Neden curl çalışıyor, tarayıcı patlıyor?
curl CORS'u zorlamaz. Tarayıcı kullanıcı adına zorlar. Sorun tamamen response header'larında (veya yokluğunda).
CORS'u sunucu tarafında 'kapatabilir miyim'?
İzin verdiğiniz alanı genişletebilirsiniz (spesifik origin, method, header, credentials). Tarayıcının kontrolünü kaldıramazsınız; sadece yanıt esnetilebilir.
Preflight yanıtlarını ne kadar cache'leyebilirim?
Access-Control-Max-Age (saniye) kullanın. 600 (10 dk) makul varsayılan; tarayıcılar gerçek değerleri kendi limitlerine kırpar (genelde 24sa).
CORS same-origin isteklere uygulanır mı?
Hayır — CORS yalnızca isteğin origin'i yanıtın origin'inden farklıyken geçerlidir. Same-origin istekler kontrolü tamamen atlar.