unt-libraries / django-nomination

A Django application for nominating URLs by project.
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Nominating an URL length 255-300 chars responds with a 404 #114

Open ldko opened 2 months ago

ldko commented 2 months ago

Example url causing a problem when nominating: https://nces.ed.gov/pubsearch/index.asp?PubSectionID=1&HasSearched=1&pubspagenum=1&sort=3&order=0&L1=&L2=&searchstring=*&pagesize=15&searchtype=AND&searchcat2=&searchcat=title&searchmonth=1&searchyear=1980&datetype=ge&pubtype=&surveyname=&surveyid=&centername=NCES&center=NCES

Though we allow URL entity to be 300 chars, we only allow value to be 255 chars. I think the problem is that when you nominate via the form, it also tries to create a SURT form of the URL and put that in the database, but where it tries to stick that in value, it only allows 255 chars, so the whole nomination is failing. I think we used to have the database backend configured to truncate values if they were too long, which is probably why if we extended the allowed length of the URL at some point but not where the surt goes, it didn't error in the past on longer URLs