fix(panel): read outbound protocol ids case-insensitively everywhere (#6523)

Six more readers compared an outbound's protocol id exactly while the core
lowercases it, so an outbound spelled "Blackhole" passed every
excludeBlackhole filter (offered as an mtproto egress, a dialerProxy
target and the geodata download egress, all of which then drop the
traffic) and one spelled "Freedom" was queued by Test All Outbounds. They
now share isOutboundProtocol.
This commit is contained in:
BlindMaster24
2026-09-14 16:02:58 +03:00
committed by GitHub
parent 39ce7cbc22
commit c0c2dd274c
8 changed files with 123 additions and 8 deletions
@@ -1,3 +1,13 @@
// xray-core lowercases a protocol id before it resolves the handler, so a
// template pasted as "Freedom" still runs as the freedom outbound.
export function isOutboundProtocol(
outbound: { protocol?: unknown } | null | undefined,
id: string,
): boolean {
const protocol = outbound?.protocol;
return typeof protocol === 'string' && protocol.toLowerCase() === id;
}
export const OutboundProtocols = Object.freeze({
Freedom: 'freedom',
Blackhole: 'blackhole',