次の方法で共有


URL を除外する

概要
目標: 開発プロキシが特定の URL をインターセプトできないようにする
時間: 3 分
前提条件:開発プロキシを設定する

傍受から URL を除外するには、! (感嘆符) を付加します。

ファイル: devproxyrc.json

{
  "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/rc.schema.json",
  "plugins": [
    {
      "name": "GenericRandomErrorPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
    }
  ],
  "urlsToWatch": [
    "https://graph.microsoft.com/v1.0/*",
    "https://graph.microsoft.com/beta/*",
    "https://graph.microsoft.us/v1.0/*",
    "https://graph.microsoft.us/beta/*",
    "https://dod-graph.microsoft.us/v1.0/*",
    "https://dod-graph.microsoft.us/beta/*",
    "https://microsoftgraph.chinacloudapi.cn/v1.0/*",
    "https://microsoftgraph.chinacloudapi.cn/beta/*",
    "!https://*.sharepoint.*/*_api/web/GetClientSideComponents",
    "https://*.sharepoint.*/*_api/*",
    "https://*.sharepoint.*/*_vti_bin/*",
    "https://*.sharepoint-df.*/*_api/*",
    "https://*.sharepoint-df.*/*_vti_bin/*"
  ]
}

上記の例では、プロキシは、/_api/web/GetClientSideComponentsに対して行われたすべての要求を無視します。

URL を除外する場合、プロキシは、構成で定義されている順序で一致する URL を検索します。

特定の URL を除外する場合は、グローバル URL の一致を増やす前に、最初に定義する必要があります。

こちらも参照ください