-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: main
Are you sure you want to change the base?
Conversation
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.
@dbrower - Is there some kind of test that you can write that proves the failure without the code change? |
@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. |
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 can you say more about the Fedora bug. Has it been reported? |
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 |
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. |
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).