This project is read-only.
1
Vote

Copy-paste bug in ResumingActionResultBase.WritePartialContent

description

For multipart requests byte range header is constructed incorrectly:
 
                response.Output.WriteLine(string.Format("{0}: bytes {1}-{2}/{3}",
                    HttpWorkerRequest.GetKnownResponseHeaderName(HttpWorkerRequest.HeaderContentRange),
                    resumingRequest.Ranges.First().StartByte, // must be range.StartByte
                    resumingRequest.Ranges.First().EndByte, // must be range.EndByte
                    fileContent.Length));

comments

VikingErik wrote Apr 20, 2012 at 5:58 PM

Your suggestion is actually what is used in each part of the multipart response. These are written to the response stream body as opposed to the header. I thought I'd pulled this code from another resource but I'm sure it could be an error. The lines you point out though don't have a 'range' in scope. I'm unsure without going back to look at the HTTP spec what the expectation is for the header vs body content for multipart responses. I'll check into this as soon as I can. Thanks for reporting it!

wrote Feb 14, 2013 at 2:05 AM