Skip to content

Commit 01c189f

Browse files
committed
fix: 更新 DefaultIpHeaderName 以包含 Cf-Connecting-Ip 標頭
1 parent bf37e01 commit 01c189f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Netcorext.Auth.Core/Extensions/HttpContextExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Netcorext.Auth.Extensions;
99

1010
public static class HttpContextExtension
1111
{
12-
private static readonly string[] DefaultIpHeaderName = { "X-Origin-Forwarded-For", "X-Forwarded-For", "X-Real-Ip" };
12+
private static readonly string[] DefaultIpHeaderName = { "Cf-Connecting-Ip", "X-Origin-Forwarded-For", "X-Forwarded-For", "X-Real-Ip" };
1313
private static readonly Regex RegexIp = new(@"(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}[^,]*)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
1414
private static readonly Regex RegexLastPath = new(@"/(\w+)$", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase);
1515

0 commit comments

Comments
 (0)