Skip to content

Conversation

JeffreySu
Copy link
Owner

No description provided.

@JeffreySu JeffreySu requested a review from Copilot June 23, 2025 17:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR standardizes sample endpoints to use HTTPS, introduces dynamic base URL resolution in OAuth2Controller, and adds local-only access checks for debug actions.

  • Replace all hard-coded http://sdk.weixin.senparc.com links with https://sdk.weixin.senparc.com.
  • Inject IHttpContextAccessor into OAuth2Controller and replace hard-coded callback URLs with dynamically constructed base URLs.
  • Add Request.IsLocal() guards in HomeController to restrict DebugOpen/DebugClose actions to local requests.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Samples/Work/Senparc.Weixin.Sample.Work/Controllers/WorkController.cs Updated validation URL comment to HTTPS
Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers/TenPayApiV3Controller.cs Updated QR code URL to HTTPS
Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Controllers/TenPayV3Controller.cs Updated QR code URL to HTTPS
Samples/MP/Senparc.Weixin.Sample.MP/Views/Home/Index.cshtml Updated OAuth callback URLs to HTTPS
Samples/MP/Senparc.Weixin.Sample.MP/Controllers/WeixinController.cs Updated validation URL comment to HTTPS
Samples/MP/Senparc.Weixin.Sample.MP/Controllers/OAuth2Controller.cs Updated OAuth callback URLs to HTTPS
Samples/MP/Senparc.Weixin.Sample.MP.Simple/Views/Home/Index.cshtml Updated OAuth callback URLs to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/Work/WorkController.cs Updated validation URL comment to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/TenPay/TenPayV3Controller.cs Updated QR code URL to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/TenPay/TenPayApiV3Controller.cs Updated QR code URL to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/Open/OpenOAuthController.cs Updated OpenOAuth callback URLs to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/Open/OpenController.cs Updated Open callback URL to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/MP/WeixinController_OldPost.cs Updated SDK links in responses to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/MP/WeixinController.cs Updated validation URL comment to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/MP/OAuth2Controller.cs Injected IHttpContextAccessor and dynamic URLs
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/MP/AsyncMethodsController.cs Updated SDK info link in template remark to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Tools/FilterTestController.cs Updated external test URLs to HTTPS
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/HomeController.cs Added local-only check for DebugOpen/DebugClose
Comments suppressed due to low confidence (1)

Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Controllers/Weixin/MP/OAuth2Controller.cs:37

  • [nitpick] Injecting IHttpContextAccessor in a controller is unnecessary since you can directly use the controller's HttpContext property. Consider removing the DI and referencing HttpContext directly to simplify dependencies.
        public OAuth2Controller(IHttpContextAccessor httpContextAccessor)

@JeffreySu JeffreySu merged commit 2679131 into master Jun 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant