Skip to content

Commit

Permalink
Senparc.Weixin v6.1.1 还原 v6.0.4 的修改
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySu committed Sep 17, 2018
1 parent d706ba4 commit cc102c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net35;net40;net45;netstandard2.0;netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
<Version>6.1.0</Version>
<Version>6.1.1</Version>
<AssemblyName>Senparc.Weixin</AssemblyName>
<RootNamespace>Senparc.Weixin</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down Expand Up @@ -270,7 +270,9 @@
v6.0.0 支持 NeuChar 标准,分离 MessageHandlers 和 WeixinContext
v6.0.1 支持 CO2NET v0.2.10
v6.0.2 优化 NeuChar 标准
v6.0.4 UrlUtility.GenerateOAuthCallbackUrl() 方法,更好支持反向代理
v6.1.0 支持 Senparc.NeuChar v0.1.2,BaseContainer.GetFirstOrDefaultAppId() 方法添加 PlatformType 属性
v6.1.1 还原 v6.0.4 的修改
</PackageReleaseNotes>
<RepositoryUrl>https://github.com/JeffreySu/WeiXinMPSDK</RepositoryUrl>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ and limitations under the License.
修改描述:v5.1.3 优化 UrlUtility.GenerateOAuthCallbackUrl() 方法
修改标识:Senparc - 20180909
修改描述:v16.2.1 UrlUtility.GenerateOAuthCallbackUrl() 方法,更好支持反向代理
修改描述:v6.0.4 UrlUtility.GenerateOAuthCallbackUrl() 方法,更好支持反向代理
修改标识:Senparc - 20180917
修改描述:v6.1.1 还原上一个版本 v6.0.4 的修改
----------------------------------------------------------------*/

using System;
Expand Down Expand Up @@ -82,10 +84,7 @@ public static string GenerateOAuthCallbackUrl(HttpContext httpContext, string oa
throw new WeixinNullReferenceException("httpContext.Request.Url 不能为null!", httpContext.Request);
}

//var returnUrl = httpContext.Request.Url.ToString();
var returnUrl = "{0}://{1}{2}"
.FormatWith(httpContext.Request.Url.Scheme, httpContext.Request.Headers["Host"], httpContext.Request.Url.PathAndQuery);

var returnUrl = httpContext.Request.Url.ToString();
var urlData = httpContext.Request.Url;
var scheme = urlData.Scheme;//协议
var host = urlData.Host;//主机名(不带端口)
Expand All @@ -104,12 +103,8 @@ public static string GenerateOAuthCallbackUrl(HttpContext httpContext, string oa
var returnUrl = request.AbsoluteUri();
var urlData = httpContext.Request;
var scheme = urlData.Scheme;//协议

//var host = urlData.Host.Host;//主机名(不带端口)
//var port = urlData.Host.Port ?? -1;//端口(因为从.NET Framework移植,因此不直接使用urlData.Host)
var host = httpContext.Request.Headers["Host"];
var port = string.IsNullOrEmpty(httpContext.Request.Headers["Port"]) ? -1 : int.Parse(httpContext.Request.Headers["Port"]);

var host = urlData.Host.Host;//主机名(不带端口)
var port = urlData.Host.Port ?? -1;//端口(因为从.NET Framework移植,因此不直接使用urlData.Host)
string portSetting = null;//Url中的端口部分
string schemeUpper = scheme.ToUpper();//协议(大写)
#endif
Expand Down

0 comments on commit cc102c4

Please sign in to comment.