File tree Expand file tree Collapse file tree
v2rayN/ServiceLib/Services/CoreConfig/V2ray Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -491,7 +491,6 @@ private void FillBoundStreamSettings(Outbounds4Ray outbound)
491491 //ws
492492 case nameof ( ETransport . ws ) :
493493 WsSettings4Ray wsSettings = new ( ) ;
494- wsSettings . headers = new Headers4Ray ( ) ;
495494
496495 if ( host . IsNotEmpty ( ) )
497496 {
@@ -503,6 +502,7 @@ private void FillBoundStreamSettings(Outbounds4Ray outbound)
503502 }
504503 if ( useragent . IsNotEmpty ( ) )
505504 {
505+ wsSettings . headers ??= new Headers4Ray ( ) ;
506506 wsSettings . headers . UserAgent = useragent ;
507507 }
508508 streamSettings . wsSettings = wsSettings ;
@@ -522,6 +522,7 @@ private void FillBoundStreamSettings(Outbounds4Ray outbound)
522522 }
523523 if ( useragent . IsNotEmpty ( ) )
524524 {
525+ httpupgradeSettings . headers ??= new Headers4Ray ( ) ;
525526 httpupgradeSettings . headers . UserAgent = useragent ;
526527 }
527528 streamSettings . httpupgradeSettings = httpupgradeSettings ;
You can’t perform that action at this time.
0 commit comments