Keep the control plane's fetches off link-local addresses, and see through NAT64, 6to4 and proxies

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 10:48:01 +02:00
1 parent fbac1aa664
commit a56ad8e4c4
8 files changed
+260 -60

No files matched your search

+5 -1
View File
@@ -6,6 +6,8 @@ import (
"net/http"
"strings"
"time"
"gitea.mynodes.xyz/ilker/llmgw/internal/safedial"
)
// Check asks whether a model's weights are actually there.
@@ -36,7 +38,9 @@ func Check(ctx context.Context, source string) (size int64, err error) {
if err != nil {
return 0, err
}
resp, err := http.DefaultClient.Do(req)
// Not anything link-local: instance metadata answering a HEAD would be
// read through this, by whoever can add a model.
resp, err := safedial.Client(safedial.ControlPlane, 0).Do(req)
if err != nil {
return 0, fmt.Errorf("cannot reach %s: %w", url, err)
}