Closed kcclaas closed 2 years ago
Thank you for the pull request! I will need to review it before merging. If there are any changes that need to be made I will note them in a review so that you can update your pull request.
I created #63 because your pull request was just too different from this project's style and it did not seem fare to ask you to change so much. Thank you for submitting this pull request, I hope that you submit more in the future.
Please ensure you have completed the following before submitting:
gradle clean check
to ensure existing functionality wasn't broken and code meets quality standards.If the build fails, please fix it because the pull request will not be merged until it builds without any errors.
These changes update the percent encoding to meet the BagIt 1.0 spec, as brought up by @pwinkles in this issue. In particular,
%
characters are now encoded to/decoded from%25
. It also includes fallback logic when reading and verifying bags so that manifests where the%
wasn't encoded properly are still considered valid, with a warning logged.When fetch files are decoded, they are assumed to be encoded correctly since there is no way to verify what they should have been. However, per the spec, only
%
,lf
, andcr
characters get percent encoded, so if an implementation encodedlf
andcr
but not%
, the end result should be the same since only%25
,%0A
, and%0D
are decoded. The only exception would be if the manifest did not encode%
, but still had%25
in it (or the other two with implementations that do no percent encoding).