Fix fedora download bug for files with commas in the filename #1083
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this Pull Request do?
Fixes a bug when downloading files from fedora that have a comma in the URI.
Consider a drupal flysystem URI like
When Drupal requests the file from fedora, fedora returns headers like this (notice
%2C
percent encoding no longer exists,
)And subsequently GuzzleHttp\Psr7\Header::parse will split on the commas, returning headers in an unexpected format.
The way flysystem handles any errors (even warnings) causes the request to fail (from watchdog)
How should this be tested?
I feel this change is straightforward enough it does not need tested. Though i guess uploading a file that will be percent encoded in fedora, then trying to download it, will make the error trip. This test script also reveals the error
Then run the script and you can see the first element of the array does not have the
rel
keyInterested parties
@Islandora/committers
@whikloj