Description
When submitting a compression job through the web UI, if a user enters text in the Dataset input field and then removes it, an empty string "" can be sent to the backend. This bypasses the fallback logic that sets the dataset to the default value, resulting in 400 errors.
Current Behavior
The code currently checks only for undefined:
payload.dataset = ("undefined" === typeof values.dataset) ?
CLP_DEFAULT_DATASET_NAME :
values.dataset;
This allows an empty string to pass through without applying the fallback.
Expected Behavior
The validation should also check for empty strings and apply the same fallback override when values.dataset.length === 0.
Suggested Fix
payload.dataset = ("undefined" === typeof values.dataset || 0 === values.dataset.length) ?
CLP_DEFAULT_DATASET_NAME :
values.dataset;
References
Description
When submitting a compression job through the web UI, if a user enters text in the Dataset input field and then removes it, an empty string
""can be sent to the backend. This bypasses the fallback logic that sets the dataset to the default value, resulting in 400 errors.Current Behavior
The code currently checks only for
undefined:This allows an empty string to pass through without applying the fallback.
Expected Behavior
The validation should also check for empty strings and apply the same fallback override when
values.dataset.length === 0.Suggested Fix
References