Skip to content

OnroerendErfgoed/urihandler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bfabf55 · Apr 25, 2023
Mar 28, 2023
Mar 28, 2023
Jun 15, 2022
Sep 24, 2015
Jun 15, 2022
Jun 15, 2022
Apr 25, 2023
Jul 6, 2022
Sep 24, 2015
Sep 24, 2015
Apr 12, 2016
Sep 27, 2015
Sep 27, 2015
Dec 26, 2022
Jun 15, 2022
Sep 27, 2015
Apr 25, 2023
Dec 7, 2020

Repository files navigation

UriHandler

https://badge.fury.io/py/urihandler.png https://travis-ci.org/OnroerendErfgoed/urihandler.png?branch=master https://coveralls.io/repos/OnroerendErfgoed/urihandler/badge.png?branch=master

This very simple application is meant to be the handler on a domain that handles Cool Uri's (http://www.w3.org/TR/cooluris/) with 303 redirects.

All it does is map Uri's to other uri's and redirect them. To make thing easy you can either redirect by hitting the full URI (eg. http://id.example.com/foo/15) or by querying a handle service (eg. http://id.example.com/handle?uri=http://id.example.com/foo/15). Both of these will redirect you. The handle service also works for non-http URI's. Finally, there's a service that just returns information without performing a redirect, eg. http://id.example.com/uris?uri=http://id.example.com/foo/15. This can be handy to bypass some of the strangeness that happens when you combine Cool uri's with CORS and custom HTTP headers.

Configuration is done by editing a YAML file. For each URI you need to register a regex and a redirect template. The regex should use named placeholders, as well as the redirect string. An optional argument mount determines if your match is living at the server root or is absolute (eg. because it's a URN). Not setting mount sets it to True.

About

Handles cool uri's

Resources

License

Citation

Stars

Watchers

Forks

Packages

No packages published

Languages