Skip to content

Add .NET 10 multi-targeting and CDN-style URL formatting compatibility - #15

Merged
chsword merged 7 commits into
masterfrom
codex/fix-274085-41134369-79850956-2304-4181-a26f-944951529bcd
Sep 27, 2026
Merged

chsword merged 7 commits into
masterfrom
codex/fix-274085-41134369-79850956-2304-4181-a26f-944951529bcd

Conversation

@Codex

@Codex Codex AI commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

This change upgrades ResizingClient compatibility to include .NET 10 while preserving existing targets and legacy URL behavior. It also adds first-class URL formatting support for Tencent CDN, Aliyun CDN, and AWS image-processing query styles without breaking existing FormatUrl usage.

  • Framework compatibility

    • Extended ResizingClient target frameworks to include net10.0 alongside net45, netstandard2.0, and net8.0.
    • Updated CI matrix targeting so SDK 8/9 jobs build net8.0 and SDK 10 job builds net10.0, avoiding cross-SDK target mismatch.
  • Backward-compatible client API

    • Added ResizingUtil.Format(...) as a compatibility alias to FormatUrl(...) to preserve older calling patterns.
    • Kept existing mode token behavior (c/m/p) unchanged for current format-string URL generation.
  • CDN URL style support

    • Added ResizingUtil.FormatTencentCdnUrl(...) for Tencent-style imageMogr2 parameters.
    • Added ResizingUtil.FormatAliyunCdnUrl(...) for Aliyun-style x-oss-process=image/resize,....
    • Added ResizingUtil.FormatAwsCdnUrl(...) for AWS-style x-amz-process=image/resize,....
    • Added shared query-appending behavior that correctly uses ? or & depending on whether the base URL already contains query parameters.
var legacy = ResizingUtil.Format("/u/face/{0}x{1}{2}.jpg", 100, 100, ResizingMode.Pad);
var tencent = ResizingUtil.FormatTencentCdnUrl("https://img.example.com/a.jpg", 100, 100, ResizingMode.Crop);
var aliyun = ResizingUtil.FormatAliyunCdnUrl("https://img.example.com/a.jpg", 100, 100, ResizingMode.Max);
var aws = ResizingUtil.FormatAwsCdnUrl("https://img.example.com/a.jpg", 100, 100, ResizingMode.Pad);

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ab.chatgpt.com
    • Triggering command: /opt/hostedtoolcache/node/24.21.0/x64/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-REDACTED-linux-musl/codex/codex (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Codex Codex AI assigned Codex and chsword Sep 27, 2026
@Codex Codex AI linked an issue Sep 27, 2026 that may be closed by this pull request
Co-authored-by: chsword <274085+chsword@users.noreply.github.com>
@Codex Codex AI changed the title [WIP] Update support for .net10 while maintaining compatibility Add .NET 10 multi-targeting and CDN-style URL formatting compatibility Sep 27, 2026
@Codex
Codex AI requested a review from chsword September 27, 2026 00:55
@chsword
chsword requested a lite review from Copilot September 27, 2026 01:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Resolve the three URL-formatting issues identified in ResizingUtil.cs, including the critical AWS syntax issue.

Review effort: Lite
Findings: 1 High severity · 2 Medium severity

Open (3)
What changed in this PR

Adds .NET 10 support and CDN-specific URL formatting while preserving legacy APIs.

Changes:

  • Adds net10.0 targeting and CI coverage.
  • Adds Format compatibility alias.
  • Adds Tencent, Aliyun, and AWS CDN URL helpers, tests, and documentation.
  • Review identified unresolved Pad mapping, AWS token, and URL-fragment handling issues.
File Description
source/​ResizingClient/​ResizingUtil.cs Adds formatting APIs and CDN URL generation.
source/​ResizingClient/​ResizingClient.csproj Adds the .NET 10 target.
source/​ResizingClient.Tests/​UnitTest1.cs Tests new formatting APIs.
README.md Documents supported frameworks and APIs.
.github/​workflows/​dotnet-ci-release.yml Updates framework-specific CI builds.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread source/ResizingClient/ResizingUtil.cs Outdated
Comment on lines +53 to +62
var fitToken = "fit_cover";
switch (mode)
{
case ResizingMode.Max:
fitToken = "fit_contain";
break;
case ResizingMode.Pad:
fitToken = "fit_pad";
break;
}
Comment thread source/ResizingClient/ResizingUtil.cs Outdated
Comment on lines +29 to +31
var query = mode == ResizingMode.Crop
? $"imageMogr2/thumbnail/{width}x{height}/gravity/center/crop/{width}x{height}"
: $"imageMogr2/thumbnail/{width}x{height}";
Comment on lines +95 to +101
static string AppendQuery(string url, string query)
{
if (string.IsNullOrWhiteSpace(url)) return url;
return url.IndexOf('?', StringComparison.Ordinal) >= 0
? $"{url}&{query}"
: $"{url}?{query}";
}
@chsword

chsword commented Sep 27, 2026

Copy link
Copy Markdown
Owner

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review thread.

Copilot AI and others added 3 commits September 27, 2026 01:51
Co-authored-by: chsword <274085+chsword@users.noreply.github.com>
Co-authored-by: chsword <274085+chsword@users.noreply.github.com>
Co-authored-by: chsword <274085+chsword@users.noreply.github.com>

Copilot AI commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, appl...

Addressed in 565368b.

@chsword

chsword commented Sep 27, 2026

Copy link
Copy Markdown
Owner

@openai-code-agent[agent] 补全单元测试

@chsword

chsword commented Sep 27, 2026

Copy link
Copy Markdown
Owner

@copilot 补全单元测试

Co-authored-by: chsword <274085+chsword@users.noreply.github.com>

Copilot AI commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

@copilot 补全单元测试

Addressed in fc2d960.

@chsword

chsword commented Sep 27, 2026

Copy link
Copy Markdown
Owner

ci 失败 是不是需要修改 @copilot

Co-authored-by: chsword <274085+chsword@users.noreply.github.com>

Copilot AI commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

ci 失败 是不是需要修改 @copilot

需要,我已经修复了导致 Windows build-server 失败的 net45 reference assemblies 问题,见 05924b2。

@chsword
chsword added this pull request to stack #17 September 27, 2026 05:29
@chsword
chsword marked this pull request as ready for review September 27, 2026 06:04
@chsword
chsword merged commit f626c09 into master Sep 27, 2026
5 of 6 checks passed
chsword added a commit that referenced this pull request Sep 27, 2026
…6-2304-4181-a26f-944951529bcd

Add .NET 10 multi-targeting and CDN-style URL formatting compatibility
@chsword
chsword deleted the codex/fix-274085-41134369-79850956-2304-4181-a26f-944951529bcd branch September 27, 2026 06:05
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.

兼容性升级

4 participants