Repository navigation
Conversation
- Normalize known PikPak upload gateways and matching bucket hosts to the HTTPS .com OSS base. - Preserve unrelated domains and custom endpoint URLs instead of stripping arbitrary labels. - Cover endpoint boundaries and actual OSS SDK URL construction for simple and multipart uploads. Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
PikPak uploads can fail before any file data reaches OSS: an endpoint such as
upload-a10b.mypikpak.combecomesvip-lixian-07.upload-a10b.mypikpak.comwhen the SDK prepends the bucket. Bucket hosts under.mypikpak.netalso fail DNS resolution.Normalize the known PikPak base domains,
upload-*gateways, and an optional matching bucket prefix tohttps://mypikpak.com, allowing the SDK to add the bucket exactly once. Apply this before both simple and multipart uploads, regardless of platform. Preserve unknown domains and URLs with custom ports, credentials, paths, queries, or fragments.Unlike unconditional first-label stripping in #2862, bare
mypikpak.com/mypikpak.netcannot becomecom/net. The.netcase in #2986 is also mapped to the working.combucket host. Tests cover these regressions, unrelated endpoints, malformed input, and the real OSS SDK's request URLs for two different buckets.Related repository PRs / 关联仓库 PR: None.
Related Issues / 关联 Issue
Fixes #2986.
Relates to #2431 and #2862.
Testing / 测试
Based on upstream
mainat482464c2affc5eeba5d4a25bb272aeb352ec5918, using Go 1.27.1 on Linux amd64.GOMAXPROCS=2 CGO_ENABLED=0 go test -p 2 -tags=jsoniter ./drivers/pikpak ./internal/net -count=1.GOMAXPROCS=2 CGO_ENABLED=0 go vet -tags=jsoniter ./drivers/pikpak.GOMAXPROCS=2 CGO_ENABLED=0 go build -p 2 -tags=jsoniter -trimpath -o /tmp/openlist-head .(output location shortened here).platform=web: fresh random 1 MiB and 16 MiB files exercise ordinary and multipart uploads; both uploads complete, both downloaded files match their original SHA-256, and the test directory is removed afterward.go test ./...was not run.The combined package test command is not fully green:
internal/netfailsTestNewOSSClientUsesEnvironmentHTTPSProxywithexpected *http.Transport, got *net.safeTransport. The same failure was reproduced in a clean worktree at the unmodified base commit withGOMAXPROCS=2 CGO_ENABLED=0 go test -p 2 -tags=jsoniter ./internal/net -run '^TestNewOSSClientUsesEnvironmentHTTPSProxy$' -count=1.Checklist / 检查清单
gofmtand checkedgit diff --check.AI Disclosure / AI 使用声明
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Tests / 测试
Documentation (PR description) / 文档
Review assistance / 审查辅助
The AI-assisted content was reviewed and validated by Codex, including the commands and live checks above.
All AI-assisted commits include
Co-authored-byattribution.Independent human reproduction without AI tools has been completed.
This contribution was prepared and submitted by Codex at the account owner's explicit request. Independent human review or reproduction is not claimed.