RDFLib / VocPrez

A tool (API and web front-end) for the read-only delivery system of SKOS vocabularies.
GNU General Public License v3.0
22 stars 13 forks source link

Respond with 4xx not 5xx to badly formulated URLs #50

Open nicholascar opened 3 years ago

nicholascar commented 3 years ago

A bot-generated URL like this:

https://linked.data.gov.au/def/geological-observation-type/radiometric%22,%22observationDate%22:%221990-05-31T14:00:00Z%22,%22AirSurvConfigNo_description%22:%22%22,%22partyRole

results in a redirect to VP like this:

https://vocabs.gsq.digital/object?vocab_id=geological-observation-type&uri=http://linked.data.gov.au/def/geological-observation-type/radiometric%22,%22observationDate%22:%221990-05-31T14:00:00Z%22,%22AirSurvConfigNo_description%22:%22%22,%22partyRole

All VP instances (1.x & 2.x) respond similarly, e.g. the DAWE instance:

http://dawe.surroundaustralia.com/object?vocab_id=geological-observation-type&uri=http://linked.data.gov.au/def/geological-observation-type/radiometric%22,%22observationDate%22:%221990-05-31T14:00:00Z%22,%22AirSurvConfigNo_description%22:%22%22,%22partyRole

VP then returns a 500, but it should return 4xx (likely 400), so a code change is needed to validate the Query String Args before querying the DB to prevent a 500 fail.