Class SelfOriginCheck

Namespace
Kuestenlogik.Bowire.Helpers
Assembly
Kuestenlogik.Bowire.dll

Helper for distinguishing "serverUrl is this very workbench host" from "serverUrl points at an external server". Used by protocol plugins that scan the local EndpointDataSource for auto-discoverable endpoints (SSE, WebSocket, SignalR) — without this check, the workbench host's OWN endpoints (e.g. /mcp when run with --enable-mcp-adapter) leak into every external serverUrl the operator adds and read as accidental services tagged to the wrong source.

public static class SelfOriginCheck
Inheritance
SelfOriginCheck
Inherited Members

Methods

IsSelfOrigin(string?, IServiceProvider?)

Returns true when serverUrl's host:port matches one of the addresses ASP.NET Core is listening on. Falls back to false when the URL cannot be parsed, when no IServerAddressesFeature is available, or when the listening addresses set is empty (test hosts / unusual hosting models).

public static bool IsSelfOrigin(string? serverUrl, IServiceProvider? serviceProvider)

Parameters

serverUrl string
serviceProvider IServiceProvider

Returns

bool

Remarks

Comparison is host (case-insensitive) + port (explicit, after the URL scheme's default is filled in). Path is ignored — a source URL of http://localhost:5180/api/foo and a server listening at http://localhost:5180/ are considered the same origin.