> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 跨域資源共享（CORS）

> 為知行之橋系統 API 配置 CORS，以允許基於瀏覽器的用戶端連線。

export const CommonCors = () => <>
    <table>
      <thead>
        <tr><th>設定</th><th>描述</th></tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>啟用跨源資源共享 (CORS)</strong></td>
          <td>是否啟用 CORS。僅當選中此框時，其餘選項才可用。</td>
        </tr>
        <tr>
          <td><strong>允許所有不帶 '*' 的域</strong></td>
          <td>如果啟用，域來源不限於特定清單。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Allow-Origin</strong></td>
          <td>要允許的以逗號分隔的域來源清單。作為 HTTP 回應訊息頭包含在內。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Allow-Credentials</strong></td>
          <td>跨域請求中是否允許使用者憑據（例如 cookie）。作為 HTTP 回應訊息頭包含在內。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Allow-Methods</strong></td>
          <td>允許的以逗號分隔的方法清單。作為 HTTP 回應訊息頭包含在內。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Allow-Headers</strong></td>
          <td>允許的訊息頭的逗號分隔清單。作為 HTTP 回應訊息頭包含在內。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Max-Age</strong></td>
          <td>可以快取 Access-Control 回應訊息頭值的最大持續時間（以秒為單位）。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const siteNameShort = "知行之橋";

您可以透過導航到[安全索引標籤](../getting-started/administration/settings/security)的[系統 API](./admin-api)部分，為系統 API 配置跨域資源共享 (CORS)。CORS 允許基於瀏覽器的用戶端連線到 {siteNameShort}。如果沒有 CORS，基於瀏覽器的指令碼將無法連線到 {siteNameShort}，因為瀏覽器強制執行了同源策略。此策略限制用戶端指令碼和文件載入其來源之外的資源。指令碼的來源由協議、主機和端口組成。

<CommonCors />
