Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
chatop2020 committed Nov 22, 2023
1 parent 932c448 commit dc98189
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 41 deletions.
40 changes: 1 addition & 39 deletions AKStreamKeeper/MediaServerInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -932,45 +932,7 @@ public bool SetConfig(out ResponseStruct rs)
_zlmNewConfig.Hook.On_Rtsp_Realm = "";
_zlmNewConfig.Rtsp.AuthBasic = 1;
}

/*if (_zlmNewConfig != null && _zlmNewConfig.Http != null &&
!_zlmNewConfig.Http.Allow_Ip_Range.Contains(h) && UtilsHelper.IsIpAddr(h))
{
if (_zlmNewConfig.Http.Allow_Ip_Range.EndsWith(","))
{
_zlmNewConfig.Http.Allow_Ip_Range += h;
}
else
{
_zlmNewConfig.Http.Allow_Ip_Range += "," + h;
}
}
if (_zlmNewConfig != null && _zlmNewConfig.Http != null &&
!_zlmNewConfig.Http.Allow_Ip_Range.Contains(h2) && UtilsHelper.IsIpAddr(h2))
{
if (_zlmNewConfig.Http.Allow_Ip_Range.EndsWith(","))
{
_zlmNewConfig.Http.Allow_Ip_Range += h2;
}
else
{
_zlmNewConfig.Http.Allow_Ip_Range += "," + h2;
}
}
if (_zlmNewConfig != null && _zlmNewConfig.Http != null &&
!_zlmNewConfig.Http.Allow_Ip_Range.Contains(h3) && UtilsHelper.IsIpAddr(h3))
{
if (_zlmNewConfig.Http.Allow_Ip_Range.EndsWith(","))
{
_zlmNewConfig.Http.Allow_Ip_Range += h3;
}
else
{
_zlmNewConfig.Http.Allow_Ip_Range += "," + h3;
}
}*/

if (_zlmNewConfig != null && _zlmNewConfig.Http != null)
{
_zlmNewConfig.Http.Allow_Ip_Range = ""; //把ip白名单去掉
Expand Down
9 changes: 7 additions & 2 deletions LibCommon/Structs/ZLMediaKitConfig/ZLMediaKitConfigNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,13 @@ public bool SetConfig(string configPath)
{
data["http"]["forwarded_ip_header"] = Http.Forwarded_Ip_Header.Trim();
}
data["http"]["allow_cross_domains"] = " "; //为了防止ip无法访问
data["http"]["allow_ip_range"] = Http.Allow_Ip_Range.Trim()+" ";//为了防止ip无法访问

if (!string.IsNullOrEmpty(Http.Allow_Cross_Domains))
{
data["http"]["allow_cross_domains"] = Http.Allow_Cross_Domains.Trim();
}

data["http"]["allow_ip_range"] = Http.Allow_Ip_Range.Trim() + " "; //为了防止ip无法访问
}

#endregion
Expand Down

0 comments on commit dc98189

Please sign in to comment.