Dela via


Exkludera en URL

Överblick
Mål: Förhindra att Dev Proxy fångar upp specifika URL:er
Tid: 3 minuter
Krav:Konfigurera Dev Proxy

Om du vill undanta en URL från att fångas upp förbereder du den med ett ! (utropstecken):

Fil: 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/*"
  ]
}

I exemplet ovan ignorerar proxyn alla begäranden som görs till /_api/web/GetClientSideComponents.

Tänk på att proxyn söker efter matchande URL:er i den ordning som de definieras i konfigurationen när du exkludera URL:er.

Om du vill exkludera specifika URL:er bör du definiera dem först innan fler globala URL:er matchar.

Se även