rubydora icon indicating copy to clipboard operation
rubydora copied to clipboard

Remove ineffective multipart option

Open dbrower opened this issue 11 years ago • 6 comments

The code looks like it is doing a multipart request, but it isn't. It is just setting the header 'Multipart' to true. I noticed this while capturing requests between an application and Fedora.

Keeping the code as is because changing it to use multipart encoding with a PUT method triggers a Fedora bug. (see https://jira.duraspace.org/browse/FCREPO-1206).

dbrower avatar Jan 07 '14 16:01 dbrower

@dbrower - Is there some kind of test that you can write that proves the failure without the code change?

jeremyf avatar Jan 16 '14 15:01 jeremyf

@jcoyne also asked me about this on IRC recently. I want to see if there was an API change in rest-client we should have used instead.

cbeer avatar Jan 16 '14 15:01 cbeer

I have code which does send a multipart request https://github.com/dbrower/rubydora/tree/multipart. But it triggers a fedora bug with the PUT method.

@jeremyf I'll think of a test. But it would require rest client to send data to a socket. I'd welcome any help if you know how to handle this.

dbrower avatar Jan 16 '14 15:01 dbrower

@dbrower can you say more about the Fedora bug. Has it been reported?

jcoyne avatar Jan 24 '14 17:01 jcoyne

Fedora bug has been reported as https://jira.duraspace.org/browse/FCREPO-1206

Fedora will not accept multipart content with PUT requests. POST requests work fine. The fedora bug report above speculates as to the reason.

What happens is that with, say, a PUT to modifyDatastream fedora will store the entire request body, including the multipart boundary markers, as the new content datastream.

I have a branch which does send fedora a multipart request and the tests fail because of this. See https://github.com/dbrower/rubydora/tree/multipart

dbrower avatar Jan 24 '14 17:01 dbrower

Just following up over here: The apache library Fedora uses to handle file uploads signals that all PUT requests are not multipart uploads. I could probably work around that, but relying on that fix would peg Rubydora to a pretty narrow band of releases (or future releases). I presume our various tests work because they go through clients that just put the ds content into the body of the request when they update content.

In any case, there's definitely a problem with the Fedora docs (thanks @dbrower !), and a problem of some kind with the approach in Fedora, but that's irrelevant here.

barmintor avatar Jan 24 '14 22:01 barmintor