Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ineffective multipart option #48

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dbrower
Copy link
Contributor

@dbrower dbrower commented Jan 7, 2014

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).

The code looks like it is doing a multipart request, but it isn't. It is
just setting the header 'Multipart' to true.

Switching the code to do a multipart encoding with a PUT method triggers
a Fedora bug.
@jeremyf
Copy link
Contributor

jeremyf commented Jan 16, 2014

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

@cbeer
Copy link
Contributor

cbeer commented Jan 16, 2014

@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.

@dbrower
Copy link
Contributor Author

dbrower commented Jan 16, 2014

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.

@jcoyne
Copy link
Contributor

jcoyne commented Jan 24, 2014

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

@dbrower
Copy link
Contributor Author

dbrower commented Jan 24, 2014

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

@barmintor
Copy link
Contributor

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.

@jrgriffiniii jrgriffiniii marked this pull request as draft May 12, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants