Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
Use existing method for generating authenticated request
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibby committed Apr 11, 2020
1 parent 8f9aa02 commit b104fb4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions paperless/downloadfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io"
"net/http"
"net/url"
"os"
"strconv"
"time"
Expand All @@ -19,6 +20,9 @@ func (p Paperless) writeFile(document Document) {
client := http.Client{Timeout: time.Second * 5}
log.Debugf("downloading from: %v", downloadURL)
req := ReturnAuthenticatedRequest(p.Username, p.Password)
req.Method = "GET"
urlPtr, _ := url.Parse(downloadURL)
req.URL = urlPtr

resp, err := client.Do(req)
if err != nil {
Expand Down

0 comments on commit b104fb4

Please sign in to comment.