RDFLib/VocPrez

Respond with 4xx not 5xx to badly formulated URLs

Opened this issue · 0 comments

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.