harvard-lil / perma

Indelible links
408 stars 72 forks source link

Validate URL if the "upload your own" form is used. #3494

Closed rebeccacremona closed 3 months ago

rebeccacremona commented 3 months ago

Fixes ENG-652.

This restores the behavior the upload-your-own form had before we migrated URL validation from the Perma application over to the Scoop API.

During that process, we accidentally removed all URL validation from the upload-your-own form, making it possible to upload links with submitted_url set to arbitrary strings. In addition to that being just plain undesirable, if certain strings were provided, it caused downstream errors, for instance, when the submitted URL was converted to a surt.

Now, you will once again see a validation error:

image

I adjusted the test suite accordingly.