HDFGroup / vol-rest

HDF5 REST VOL Connector
Other
5 stars 8 forks source link

JSON Escape group and dataset names #113

Closed mattjala closed 8 months ago

mattjala commented 9 months ago

RV_group_create and RV_dataset_create send the name of the new group/dataset as JSON in the POST body. If the name contained a legal HDF5 name character that is a control character in JSON (e.g. \), the group/dataset would be created with an incorrect name. Now, a helper function encodes the name before adding it to the request body.

This is tested by test_url_encoding in test_rest_vol.c. With versions of HSDS before HDFGroup/HSDS#296, HSDS erroneously truncates the name url_encoding_group !*'():@&=+$,?#[]-.<>\^`{}|~ to url_encoding_group !*'():@&=+$, , so the behavior with the JSON control character \ was not being tested.