Files
magpie/internal
yetone 0ce59ee613 providers: the editor's site link opens a base's host under the base's own scheme, so a local http server opens over http (#2377)
Peterpig set a custom provider's Base URL to http://127.0.0.1:7863/v1;
the link at the top right of its editor opened https://127.0.0.1:7863
and Chrome showed ERR_SSL_PROTOCOL_ERROR.

Cause: with no website, drawEditor built the link as "https://" + p.host.
p.host is provider.Host(), a display host with the scheme already cut
off, so every provider's scheme was guessed as https. hostSite now takes
the scheme from the base the host was read from (chat, responses,
anthropic, gemini, decide, matched the way provider.HostOf reads a host),
and keeps https only when no base spells the host: a subscription moved
onto its plugin shows the vendor host it had while its base is
plugin://<id>. A plugin's own provider (host without a dot or a port)
still gets no link.

Siblings checked: every api("open") call in app.js takes a full URL from
the Go side or a preset (keysUrl, website, sign-in URLs); none builds one
from a host. POST /api/open passes http:// through. The other
"https://" + host spots in app.js (hostOf, twoKeyHeaders' host check,
the S3 endpoint label) only read a host for display or matching, never
open it. provider.faviconSites looks for an icon on https only, but it
refuses local hosts first, so the reporter's case doesn't reach it.

Ran:
- new internal/gui/tests/editor-site-scheme.test.cjs (reporter's
  127.0.0.1:7863 http base, a LAN http base in upper case, an https
  base, a moved subscription, a plugin provider; clicks the link and
  checks what is opened), en and zh at 420px: BROWSER=chromium and
  BROWSER=webkit, pass 2/2 each.
- Put the old "https://" + p.host line back by hand: red in both
  engines, actual 'https://127.0.0.1:7863' vs expected
  'http://127.0.0.1:7863'. Fix restored, green again.
- tencent-cloud, copilot-ghe, zcode-site, ux-safety .test.cjs (other
  tests over the editor head and its site link), chromium and webkit:
  all pass.
- go test -tags nogui -p 1 ./internal/gui -run 'TestPageFilesRevalidate|
  TestPageNamesItsFilesByContent|TestCoreScriptBudget|TestWebCompresses|
  TestVersionedFilesKept|TestDatesFollowGUILanguage': ok.
- No Go file changed, so no gofmt/vet run.
Not tried: the real macOS app clicking the link (the browser opened is
the system's; the URL handed to it is what the test checks).

Full suite: SUITE_LINE
2026-10-15 23:08:03 +08:00
..
…
…
…