Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/core/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,18 @@ async def _prepare_subscription_inbound_data(

# Compute flow_enabled: only for VLESS with specific conditions
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says flow is computed “only for VLESS with specific conditions”, but flow_enabled is now also enabled for VLESS when inbound encryption is set. Please update the comment to reflect the full set of conditions so future readers don’t assume tls_value/transport constraints are still required.

Suggested change
# Compute flow_enabled: only for VLESS with specific conditions
# Compute flow_enabled for VLESS either when the TLS/transport/header
# constraints below are met, or when inbound VLESS encryption is set
# to a non-empty value other than "none".

Copilot uses AI. Check for mistakes.
header_type = getattr(transport_config, "header_type", "none")
flow_enabled = (
base_flow_enabled = (
protocol == "vless"
and tls_value in ("tls", "reality")
and network in ("tcp", "raw", "kcp")
and header_type != "http"
)

# Enable also when inbound vless encryption is enabled (not "none")
flow_enabled = base_flow_enabled or (
protocol == "vless" and encryption not in (None, "", "none")
Comment on lines +267 to +269
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encryption is pulled directly from inbound_config (defaulting to "none") and is not normalized. The new check encryption not in (None, "", "none") is therefore case/whitespace sensitive (e.g., "None", "NONE", or " none " would be treated as enabled and turn flow_enabled on unexpectedly). Consider normalizing once (e.g., strip + lowercase) before this comparison so the behavior matches the comment intent (“not 'none'”).

Suggested change
# Enable also when inbound vless encryption is enabled (not "none")
flow_enabled = base_flow_enabled or (
protocol == "vless" and encryption not in (None, "", "none")
normalized_encryption = encryption.strip().lower() if isinstance(encryption, str) else encryption
# Enable also when inbound vless encryption is enabled (not "none")
flow_enabled = base_flow_enabled or (
protocol == "vless" and normalized_encryption not in (None, "", "none")

Copilot uses AI. Check for mistakes.
)

return SubscriptionInboundData(
remark=host.remark,
inbound_tag=host.inbound_tag,
Expand Down
Loading