MyCoRe-Org / JSPDocportal

base modules for JSP based docportal
GNU General Public License v3.0
0 stars 2 forks source link

Problem with whitespaces in MCRLegacyMetadataController #65

Closed rsteph-de closed 1 year ago

rsteph-de commented 1 year ago

The class has problems with whitespaces in given ID. MCRObjectID.isValid() trims the input during validation, why?

For the legacy controller it could be useful to explicitly trim the input.

[java.lang.IllegalArgumentException: Illegal character in path at index 31: /resolve/id/cpr_person_00002158 ] with root cause
        java.net.URISyntaxException: Illegal character in path at index 31: /resolve/id/cpr_person_00002158
                at java.base/java.net.URI$Parser.fail(URI.java:2976)
                at java.base/java.net.URI$Parser.checkChars(URI.java:3147)
                at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3229)
        ... 
                at org.mycore.jspdocportal.common.controller.MCRLegacyMetadataController.defaultRes(MCRLegacyMetadataController.java:27)
rsteph-de commented 1 year ago

the ID validation will be improved in MyCoRe with PR https://github.com/MyCoRe-Org/mycore/pull/1946