Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 169 for Cors (0.24 seconds)

  1. docs/zh-hant/docs/tutorial/middleware.md

    {* ../../docs_src/middleware/tutorial001_py310.py hl[8:9,11,14] *}
    
    /// tip
    
    請記得,自訂的非標準標頭可以[使用 `X-` 前綴](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers)。
    
    但如果你有自訂標頭並希望瀏覽器端的用戶端能看到它們,你需要在 CORS 設定([CORS(跨來源資源共用)](cors.md))中使用 [Starlette 的 CORS 文件](https://www.starlette.dev/middleware/#corsmiddleware)所記載的參數 `expose_headers` 將它們加入。
    
    ///
    
    /// note | 技術細節
    
    你也可以使用 `from starlette.requests import Request`。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 3.7K bytes
    - Click Count (0)
  2. docs/ja/docs/tutorial/middleware.md

    /// tip | 豆知識
    
    カスタムの独自ヘッダーは [`X-` プレフィックスを使用](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers)して追加できる点に注意してください。
    
    ただし、ブラウザのクライアントに表示させたいカスタムヘッダーがある場合は、[CORS (Cross-Origin Resource Sharing)](cors.md) の設定に、[StarletteのCORSドキュメント](https://www.starlette.dev/middleware/#corsmiddleware)に記載されているパラメータ `expose_headers` を使用して、それらを追加する必要があります。
    
    ///
    
    /// note | 技術詳細
    
    `from starlette.requests import Request` を使用することもできます。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 5.2K bytes
    - Click Count (0)
  3. docs/en/docs/tutorial/middleware.md

    But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS configurations ([CORS (Cross-Origin Resource Sharing)](cors.md)) using the parameter `expose_headers` documented in [Starlette's CORS docs](https://www.starlette.dev/middleware/#corsmiddleware).
    
    ///
    
    /// note | Technical Details
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 3.9K bytes
    - Click Count (0)
  4. docs/zh/docs/advanced/strict-content-type.md

    默认情况下,FastAPI 对 JSON 请求体使用严格的 `Content-Type` 头检查。这意味着,JSON 请求必须包含有效的 `Content-Type` 头(例如 `application/json`),其请求体才会被按 JSON 解析。
    
    ## CSRF 风险 { #csrf-risk }
    
    此默认行为在一个非常特定的场景下,可防御一类跨站请求伪造(CSRF)攻击。
    
    这类攻击利用了浏览器的一个事实:当请求满足以下条件时,浏览器允许脚本在不进行任何 CORS 预检的情况下直接发送请求:
    
    - 没有 `Content-Type` 头(例如使用 `fetch()` 携带 `Blob` 作为 body)
    - 且不发送任何认证凭据。
    
    这种攻击主要在以下情况下相关:
    
    - 应用在本地(如 `localhost`)或内网中运行
    - 且应用没有任何认证,假定来自同一网络的请求都可信。
    
    ## 攻击示例 { #example-attack }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:29:48 GMT 2026
    - 3K bytes
    - Click Count (0)
  5. docs/ja/docs/advanced/middleware.md

    # 高度なミドルウェア { #advanced-middleware }
    
    メインのチュートリアルでは、アプリケーションに[カスタムミドルウェア](../tutorial/middleware.md)を追加する方法を学びました。
    
    そして、[`CORSMiddleware` を使った CORS の扱い方](../tutorial/cors.md)も学びました。
    
    このセクションでは、その他のミドルウェアの使い方を見ていきます。
    
    ## ASGI ミドルウェアの追加 { #adding-asgi-middlewares }
    
    **FastAPI** は Starlette を基盤としており、<abbr title="Asynchronous Server Gateway Interface - 非同期サーバーゲートウェイインターフェース">ASGI</abbr> 仕様を実装しているため、任意の ASGI ミドルウェアを利用できます。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 5.2K bytes
    - Click Count (0)
  6. docs/zh-hant/docs/advanced/middleware.md

    # 進階中介軟體 { #advanced-middleware }
    
    在主要教學中你已學過如何將[自訂中介軟體](../tutorial/middleware.md)加入到你的應用程式。
    
    你也讀過如何處理 [使用 `CORSMiddleware` 的 CORS](../tutorial/cors.md)。
    
    本節將示範如何使用其他中介軟體。
    
    ## 新增 ASGI 中介軟體 { #adding-asgi-middlewares }
    
    由於 **FastAPI** 建立在 Starlette 上並實作了 <abbr title="Asynchronous Server Gateway Interface - 非同步伺服器閘道介面">ASGI</abbr> 規範,你可以使用任何 ASGI 中介軟體。
    
    中介軟體不一定要為 FastAPI 或 Starlette 專門撰寫,只要遵循 ASGI 規範即可運作。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 3.9K bytes
    - Click Count (0)
  7. docs/en/docs/advanced/strict-content-type.md

    This default behavior provides protection against a class of **Cross-Site Request Forgery (CSRF)** attacks in a very specific scenario.
    
    These attacks exploit the fact that browsers allow scripts to send requests without doing any CORS preflight check when they:
    
    * don't have a `Content-Type` header (e.g. using `fetch()` with a `Blob` body)
    * and don't send any authentication credentials.
    
    This type of attack is mainly relevant when:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Feb 23 17:45:20 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  8. docs/zh/docs/advanced/middleware.md

    # 高级中间件 { #advanced-middleware }
    
    用户指南介绍了如何为应用添加[自定义中间件](../tutorial/middleware.md)。
    
    以及如何[使用 `CORSMiddleware` 处理 CORS](../tutorial/cors.md)。
    
    本章学习如何使用其它中间件。
    
    ## 添加 ASGI 中间件 { #adding-asgi-middlewares }
    
    因为 **FastAPI** 基于 Starlette,且执行 <abbr title="Asynchronous Server Gateway Interface - 异步服务器网关接口">ASGI</abbr> 规范,所以可以使用任意 ASGI 中间件。
    
    中间件不必是专为 FastAPI 或 Starlette 定制的,只要遵循 ASGI 规范即可。
    
    总之,ASGI 中间件是类,并把 ASGI 应用作为第一个参数。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 3.7K bytes
    - Click Count (0)
  9. kotlin-js-store/yarn.lock

      integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==
    
    "@types/cors@^2.8.12":
      version "2.8.13"
      resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.13.tgz#b8ade22ba455a1b8cb3b5d3f35910fd204f84f94"
      integrity sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==
      dependencies:
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Sat Jul 22 12:28:51 GMT 2023
    - 87.4K bytes
    - Click Count (0)
  10. docs/zh-hant/docs/advanced/strict-content-type.md

    ## CSRF 風險 { #csrf-risk }
    
    這個預設行為在某個非常特定的情境下,能對一類跨站請求偽造(CSRF, Cross-Site Request Forgery)攻擊提供保護。
    
    這類攻擊利用了瀏覽器在以下情況下允許腳本發送請求而不進行任何 CORS 預檢(preflight)檢查的事實:
    
    - 沒有 `Content-Type` 標頭(例如以 `fetch()` 並使用 `Blob` 作為 body)
    - 且沒有送出任何身分驗證憑證
    
    這種攻擊主要與以下情境相關:
    
    - 應用在本機(例如 `localhost`)或內部網路中執行
    - 並且應用沒有任何身分驗證,假設同一個網路中的任何請求都可被信任
    
    ## 攻擊範例 { #example-attack }
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:33:04 GMT 2026
    - 3.1K bytes
    - Click Count (0)
Back to Top