Skip to content

Commit

Permalink
use GET header on measure check
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Feb 24, 2024
1 parent b4bef1b commit 3b5767b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage_webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func (s *WebDavStorage) ServeMeasure(rw http.ResponseWriter, req *http.Request,
if err != nil {
return err
}
tgReq, err := http.NewRequestWithContext(req.Context(), http.MethodHead, target, nil)
tgReq, err := http.NewRequestWithContext(req.Context(), http.MethodGet, target, nil)
if err != nil {
return err
}
Expand Down Expand Up @@ -436,6 +436,7 @@ func (s *WebDavStorage) ServeMeasure(rw http.ResponseWriter, req *http.Request,
// Do not read empty file from webdav, it's not helpful
fallthrough
default:
resp.Body.Close()
rw.Header().Set("Content-Length", strconv.Itoa(size*mbChunkSize))
rw.WriteHeader(http.StatusOK)
if req.Method == http.MethodGet {
Expand Down

0 comments on commit 3b5767b

Please sign in to comment.