Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions drivers/115/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package _115

import (
"context"
"net/http"
"strings"
"sync"

Expand Down Expand Up @@ -78,6 +79,16 @@ func (d *Pan115) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
URL: downloadInfo.Url.Url,
Header: downloadInfo.Header,
}
// The 115 CDN requires the account Cookie on the download request, but the
// SDK sends cookies at the transport layer so they are absent from
// downloadInfo.Header. Without it, proxied downloads fail with
// 403 "no cookie value". Restore the Cookie so proxy mode works.
if link.Header == nil {
link.Header = http.Header{}
}
if link.Header.Get("Cookie") == "" {
link.Header.Set("Cookie", d.Cookie)
}
return link, nil
}

Expand Down
Loading