Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Escape group and dataset names #113

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

mattjala
Copy link
Collaborator

@mattjala mattjala commented Jan 9, 2024

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.

@mattjala mattjala added bug Something isn't working testing Related to testing process labels Jan 9, 2024
@jhendersonHDF jhendersonHDF merged commit 698ed84 into HDFGroup:master Jan 16, 2024
6 checks passed
@mattjala mattjala deleted the encode_test_fix branch March 21, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing Related to testing process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants