Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 427666

Summary: File upload via transfer api with multipart chunks is broken
Product: [ECD] Orion Reporter: Michael Ochmann <michael.ochmann>
Component: ServerAssignee: Project Inbox <orion.server-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mamacdon
Version: 5.0   
Target Milestone: 5.0 RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Ochmann CLA 2014-02-07 09:20:22 EST
Uploading a file in chunks with the usual POST/PUT sequence,

POST /xfer/import/project/file
PUT  /xfer/import/23A43
....

always fails with "Content-Range doesn't agree with Content-Length" on the first PUT, when the chunks are delivered with a multipart content type. This ought to work according to the implementation in ClientImport.

The reason for the failure is a check in ClientImport that enforces the request Content-Length to be equal to the announced byte range in the Range header. For multipart bodies, however, the Content-Length always is larger than the actual chunk length, because of the boundary delimiters enclosing the chunk.

I'll provide a patch and test case on Gerrit.
Comment 1 Michael Ochmann CLA 2014-02-07 09:22:53 EST
https://git.eclipse.org/r/#/c/21679/
Comment 2 Mark Macdonald CLA 2014-04-16 14:25:03 EDT
The patch was merged. Making as FIXED.