You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ro...@apache.org on 2018/06/04 20:49:47 UTC
[incubator-trafficcontrol] 04/15: Fix range header in certain cases
(more testing helps)
This is an automated email from the ASF dual-hosted git repository.
rob pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
commit 7c7fa759beab8d3e55e24ddacfe996e1a9d53e1d
Author: Jan van Doorn <jv...@knutsel.com>
AuthorDate: Fri May 25 11:14:20 2018 -0600
Fix range header in certain cases (more testing helps)
---
grove/plugin/range_req_handler.go | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/grove/plugin/range_req_handler.go b/grove/plugin/range_req_handler.go
index 25e21b8..bdc1e07 100644
--- a/grove/plugin/range_req_handler.go
+++ b/grove/plugin/range_req_handler.go
@@ -167,13 +167,14 @@ func rangeReqHandleBeforeRespond(icfg interface{}, d BeforeRespondData) {
thisRange.End = totalContentLength - 1
}
- rangeString := "bytes " + strconv.FormatInt(thisRange.Start, 10) + "-" + strconv.FormatInt(thisRange.End, 10) + "\r\n\r\n"
+ rangeString := "bytes " + strconv.FormatInt(thisRange.Start, 10) + "-" + strconv.FormatInt(thisRange.End, 10)
log.Debugf("range:%d-%d\n", thisRange.Start, thisRange.End)
if multipart {
body = append(body, []byte("\r\n--"+multipartBoundaryString+"\r\n")...)
body = append(body, []byte("Content-type: "+originalContentType+"%s\r\n")...)
- body = append(body, []byte("Content-range: "+rangeString)...)
+ body = append(body, []byte("Content-range: "+rangeString+"\r\n\r\n")...)
} else {
+ log.Debugf("Adding Range Header (should only happen once: %s\n", rangeString+"/"+strconv.FormatInt(totalContentLength, 10))
d.Hdr.Add("Content-Range", rangeString+"/"+strconv.FormatInt(totalContentLength, 10))
}
bSlice := (*d.Body)[thisRange.Start : thisRange.End+1]
--
To stop receiving notification emails like this one, please contact
rob@apache.org.