-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Krill version: v0.10.0-rc2
Submitting a valid RFC 8183 repository response XML via the Repository tab in the UI will fail with an "Invalid JSON" error.
This appears to be because the Krill server code checks for a leading < character to determine if the request body contains XML as opposed to JSON, but since Lagosta commit NLnetLabs/lagosta@8eb658c the UI, before sending the valid XML, first double quotes the XML and escapes embedded double quotes, e.g. according to FireFox it does the equivalent of the following HTTP POST:
(omitting most HTTP request headers, with added embedded line breaks for readability)
curl 'https://localhost:3000/api/v1/cas/ca_readwrite/repo' \
-H 'Content-Type: application/json' \
--data-raw '"\n
<repository_response xmlns=\"http://www.hactrn.net/uris/rpki/rpki-setup/\" version=\"1\"
publisher_handle=\"ca_readwrite1660229837597\" service_uri=\"https://localhost:3000/rfc8181/ca_readwrite1660229837597/\" sia_base=\"rsync://localhost/repo/ca_readwrite1660229837597/\" rrdp_notification_uri=\"https://localhost/rrdp/notification.xml\">\n
<repository_bpki_ta>\n
MIID...r1ZM=\n
</repository_bpki_ta>\n
</repository_response>"' \
--compressed \
--insecure
Note it also still sends a Content-Type: application/json header as well which is clearly wrong...
This causes the UI tests to fail. Blindly reverting the Lagosta commit mentioned above "solves" the problem.