Skip to content

Commit

Permalink
Fix links for specific recipient
Browse files Browse the repository at this point in the history
  • Loading branch information
gnojus committed Jun 18, 2020
1 parent 08e37b4 commit e224f2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion transfer/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type headers map[string]string
type requestData struct {
Security_hash string `json:"security_hash"`
Domain_user_id string `json:"domain_user_id"`
RecipientId string `json:"recipient_id"`
}

type transferData struct {
Expand Down Expand Up @@ -83,7 +84,6 @@ func getDownloadLink(client *http.Client, data transferData) (URL string, err er
if err != nil {
return
}

var result map[string]interface{}
err = json.Unmarshal(body, &result)
if err != nil {
Expand Down Expand Up @@ -114,6 +114,8 @@ func getTransferData(resp *http.Response) (out transferData, err error) {
if out.req_data.Domain_user_id, ok = findVar(`user: {"key":"`, body); !ok {
return out, errors.New("Unable to get domain user id")
}
out.req_data.RecipientId, _ = findVar(`"recipient_id":"`, body)

if out.wt_session, ok = getCookieValue("_wt_session", resp); !ok {
return out, errors.New("Unable to get _wt_session cookie")
}
Expand Down
2 changes: 1 addition & 1 deletion transfer/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path"
)

func GetWriter(output string, dir string, force bool) (out io.Writer, err error) {
func GetWriter(output string, dir string, force bool) (out io.WriteCloser, err error) {
if output == "-" {
out = os.Stdout
return
Expand Down

0 comments on commit e224f2c

Please sign in to comment.