mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-17 07:37:15 +00:00
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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user