Skip to content

Commit

Permalink
Merge pull request #718 from OnroerendErfgoed/bugfix/708-500-exceptio…
Browse files Browse the repository at this point in the history
…n-when-using-unexpected-

#708 allow only integer routes for concepts
  • Loading branch information
JonasGe authored Aug 22, 2022
2 parents 2ba4c5d + cc8a52b commit ba7e3cc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions atramhasis/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def includeme(config):

config.add_route('conceptschemes', pattern='/conceptschemes', accept='text/html', request_method="GET")
config.add_route('conceptscheme', pattern='/conceptschemes/{scheme_id}', accept='text/html', request_method="GET")
config.add_route('concept', pattern='/conceptschemes/{scheme_id}/c/{c_id}', accept='text/html',
config.add_route('concept', pattern='/conceptschemes/{scheme_id}/c/{c_id:\\d{1,9}}', accept='text/html',
request_method="GET")
config.add_route('search_result', pattern='/conceptschemes/{scheme_id}/c', accept='text/html')
config.add_route('scheme_root', pattern='/conceptschemes/{scheme_id}/c/', accept='text/html')
Expand All @@ -52,13 +52,13 @@ def includeme(config):
accept='application/json', request_method='PUT')
config.add_route('atramhasis.get_conceptscheme', pattern='/conceptschemes/{scheme_id}', accept='application/json')
config.add_route('atramhasis.get_conceptschemes', pattern='/conceptschemes', accept='application/json')
config.add_route('atramhasis.get_concept', pattern='/conceptschemes/{scheme_id}/c/{c_id}',
config.add_route('atramhasis.get_concept', pattern='/conceptschemes/{scheme_id}/c/{c_id:\\d{1,9}}',
accept='application/json', request_method="GET")
config.add_route('atramhasis.add_concept', pattern='/conceptschemes/{scheme_id}/c', accept='application/json',
request_method="POST")
config.add_route('atramhasis.edit_concept', pattern='/conceptschemes/{scheme_id}/c/{c_id}',
config.add_route('atramhasis.edit_concept', pattern='/conceptschemes/{scheme_id}/c/{c_id:\\d{1,9}}',
accept='application/json', request_method="PUT")
config.add_route('atramhasis.delete_concept', pattern='/conceptschemes/{scheme_id}/c/{c_id}',
config.add_route('atramhasis.delete_concept', pattern='/conceptschemes/{scheme_id}/c/{c_id:\\d{1,9}}',
accept='application/json', request_method="DELETE")
config.add_route('atramhasis.list_languages', pattern='/languages', accept='application/json',
request_method="GET")
Expand Down Expand Up @@ -87,13 +87,13 @@ def includeme(config):
accept='text/turtle')
config.add_route('atramhasis.rdf_conceptscheme_export_turtle_x', pattern='/conceptschemes/{scheme_id}',
accept='application/x-turtle')
config.add_route('atramhasis.rdf_individual_export', pattern='/conceptschemes/{scheme_id}/c/{c_id}',
config.add_route('atramhasis.rdf_individual_export', pattern='/conceptschemes/{scheme_id}/c/{c_id:\\d{1,9}}',
accept='application/rdf+xml')
config.add_route('atramhasis.rdf_individual_export_turtle', pattern='/conceptschemes/{scheme_id}/c/{c_id}',
config.add_route('atramhasis.rdf_individual_export_turtle', pattern='/conceptschemes/{scheme_id}/c/{c_id:\\d{1,9}}',
accept='text/turtle')
config.add_route('atramhasis.rdf_individual_export_turtle_x', pattern='/conceptschemes/{scheme_id}/c/{c_id}',
config.add_route('atramhasis.rdf_individual_export_turtle_x', pattern='/conceptschemes/{scheme_id}/c/{c_id:\\d{1,9}}',
accept='application/x-turtle')
config.add_route('atramhasis.rdf_conceptscheme_jsonld', pattern='/conceptschemes/{scheme_id}',
accept='application/ld+json')
config.add_route('atramhasis.rdf_individual_jsonld', pattern='/conceptschemes/{scheme_id}/c/{c_id}',
config.add_route('atramhasis.rdf_individual_jsonld', pattern='/conceptschemes/{scheme_id}/c/{c_id:\\d{1,9}}',
accept='application/ld+json')

0 comments on commit ba7e3cc

Please sign in to comment.