mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-25 00:48:45 +00:00
fix(urns): prevent corrupting whitespace trailing or leading urns to be created (#3348)
This commit is contained in:
parent
03bbfd0b2a
commit
a5926a5507
@ -66,7 +66,7 @@ export default function CreateTagModal({
|
||||
})
|
||||
.catch((e) => {
|
||||
message.destroy();
|
||||
message.error({ content: `Failed to remove term: \n ${e.message || ''}`, duration: 3 });
|
||||
message.error({ content: `Failed to create & add tag: \n ${e.message || ''}`, duration: 3 });
|
||||
onClose();
|
||||
});
|
||||
};
|
||||
|
||||
@ -202,6 +202,11 @@ public class EbeanEntityService extends EntityService {
|
||||
@Nonnull final SystemMetadata systemMetadata) {
|
||||
|
||||
log.debug("Invoked ingestAspect with urn: {}, aspectName: {}, newValue: {}", urn, aspectName, newValue);
|
||||
|
||||
if (!urn.toString().trim().equals(urn.toString())) {
|
||||
throw new IllegalArgumentException("Error: cannot provide an URN with leading or trailing whitespace");
|
||||
}
|
||||
|
||||
Timer.Context ingestToLocalDBTimer = MetricUtils.timer(this.getClass(), "ingestAspectToLocalDB").time();
|
||||
UpdateAspectResult result = ingestAspectToLocalDB(urn, aspectName, ignored -> newValue, auditStamp, systemMetadata,
|
||||
DEFAULT_MAX_TRANSACTION_RETRY);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user