Compare commits

..

6 Commits

2 changed files with 1 additions and 13 deletions

View File

@ -12,7 +12,6 @@ import (
"strings" "strings"
_ "github.com/alist-org/alist/v3/drivers" _ "github.com/alist-org/alist/v3/drivers"
"github.com/alist-org/alist/v3/internal/bootstrap"
"github.com/alist-org/alist/v3/internal/bootstrap/data" "github.com/alist-org/alist/v3/internal/bootstrap/data"
"github.com/alist-org/alist/v3/internal/conf" "github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/op" "github.com/alist-org/alist/v3/internal/op"
@ -138,7 +137,6 @@ var LangCmd = &cobra.Command{
Use: "lang", Use: "lang",
Short: "Generate language json file", Short: "Generate language json file",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
bootstrap.InitConfig()
err := os.MkdirAll("lang", 0777) err := os.MkdirAll("lang", 0777)
if err != nil { if err != nil {
utils.Log.Fatalf("failed create folder: %s", err.Error()) utils.Log.Fatalf("failed create folder: %s", err.Error())

View File

@ -45,17 +45,7 @@ func Proxy(w http.ResponseWriter, r *http.Request, link *model.Link, file model.
if err != nil { if err != nil {
return fmt.Errorf("failed to read markdown content: %w", err) return fmt.Errorf("failed to read markdown content: %w", err)
} }
} else if link.RangeReadCloser != nil {
attachHeader(w, file)
rrc, err := link.RangeReadCloser.RangeRead(r.Context(), http_range.Range{Start: 0, Length: -1})
if err != nil {
return err
}
defer rrc.Close()
markdownContent, err = io.ReadAll(rrc)
if err != nil {
return fmt.Errorf("failed to read markdown content: %w", err)
}
} else { } else {
header := net.ProcessHeader(r.Header, link.Header) header := net.ProcessHeader(r.Header, link.Header)
res, err := net.RequestHttp(r.Context(), r.Method, header, link.URL) res, err := net.RequestHttp(r.Context(), r.Method, header, link.URL)