修复本地模式下路由问题

This commit is contained in:
dragon
2026-01-27 17:32:36 +08:00
parent 1c52ee05b6
commit cd573483ea
2 changed files with 10 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ import (
"net/http/httptest"
"os"
"path/filepath"
"slices"
"strconv"
"strings"
"time"
@@ -42,7 +43,14 @@ func (l *LocalProvider) Close() error {
return nil
}
func (l *LocalProvider) Meta(_ context.Context, _, _ string) (*core.Metadata, error) {
func (l *LocalProvider) Meta(_ context.Context, owner, repo string) (*core.Metadata, error) {
if _, ok := l.graph[owner]; !ok {
return nil, os.ErrNotExist
}
if !slices.Contains(l.graph[owner], repo) {
return nil, os.ErrNotExist
}
return &core.Metadata{
ID: "localhost",
LastModified: time.Now(),