Skip to content

Commit

Permalink
fix(123): judge status on get redirect_url (close #4718)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jul 7, 2023
1 parent 8bdc67e commit d17f7f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/123/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (d *Pan123) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
log.Debugln("res code: ", res.StatusCode())
if res.StatusCode() == 302 {
link.URL = res.Header().Get("location")
} else if res.StatusCode() == 200 {
} else if res.StatusCode() < 300 {
link.URL = utils.Json.Get(res.Body(), "data", "redirect_url").ToString()
}
link.Header = http.Header{
Expand Down

0 comments on commit d17f7f7

Please sign in to comment.