Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sagan committed Jan 6, 2024
1 parent ca08de5 commit b6866c0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions site/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ func DownloadTorrentByUrl(siteInstance Site, httpClient *azuretls.Session, torre
return nil, "", fmt.Errorf("server return invalid content-type: %s", mimeType)
}
filename := ""
_, params, err := mime.ParseMediaType(header.Get("content-disposition"))
if err == nil {
if _, params, err := mime.ParseMediaType(header.Get("content-disposition")); err == nil {
unescapedFilename, err := url.QueryUnescape(params["filename"])
if err == nil {
filename = unescapedFilename
Expand Down

0 comments on commit b6866c0

Please sign in to comment.