rdf4j
rdf4j copied to clipboard
Create/update namespace endpoint does not validate the prefix and the URI
Current Behavior
I can create/update a prefix with invalid prefix and URI, there's no validation in the endpoint.
Expected Behavior
There should be a validation of the URI at least, I'm not sure about the prefix, but I guess creating a prefix with a space or < > in it should not be allowed as well.
Steps To Reproduce
-
Execute the following: curl 'http://localhost:7222/repositories/x/namespaces/asd%20c' -X 'PUT' --data-raw 'http://xxx.com'
-
The namespace is created successfully although the prefix has a space in it (asd c)
-
Execute the following curl 'http://localhost:7222/repositories/x/namespaces/asd' -X 'PUT' --data-raw 'httpxxxcom'
-
The namespace is created with URI httpxxxcom
Version
4.0.0-M2
Are you interested in contributing a solution yourself?
No response
Anything else?
No response