پیشگیری از XSS و XSRF
برای محافظت در برابر اسکریپت بین سایتی (XSS)، به هدر HTTP X-Content-Type-Options: nosniff
. همچنین شامل Content-Type: application/json; charset=utf-8
در هدر پاسخ.
برای محافظت در برابر جعل درخواست های متقابل سایت (XSRF)، برای همه درخواست ها به هدر HTTP X-XSRF-Protected: 1
نیاز است.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-11-08 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-11-08 بهوقت ساعت هماهنگ جهانی."],[[["All responses must include the `X-Content-Type-Options: nosniff` and `Content-Type: application/json; charset=utf-8` headers to mitigate cross-site scripting (XSS) vulnerabilities."],["All requests must include the `X-XSRF-Protected: 1` header to defend against cross-site request forgery (XSRF) attacks."]]],["Responses should include `X-Content-Type-Options: nosniff` and `Content-Type: application/json; charset=utf-8` headers to prevent cross-site scripting (XSS). To prevent cross-site request forgery (XSRF), all requests must include the `X-XSRF-Protected: 1` header. These actions enhance security by ensuring content types are strictly interpreted and verifying the origin of requests, thus mitigating common web vulnerabilities.\n"]]