{"id":32191301,"url":"https://github.com/invetica/redirects","last_synced_at":"2026-07-16T15:32:11.130Z","repository":{"id":62432985,"uuid":"88525804","full_name":"invetica/redirects","owner":"invetica","description":"Canonical redirects for your URL.","archived":false,"fork":false,"pushed_at":"2017-08-03T11:22:47.000Z","size":17,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-22T01:36:41.614Z","etag":null,"topics":["clojure","http","redirects","ring"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/invetica.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-17T16:09:12.000Z","updated_at":"2023-08-07T08:16:29.000Z","dependencies_parsed_at":"2022-11-01T20:45:46.329Z","dependency_job_id":null,"html_url":"https://github.com/invetica/redirects","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/invetica/redirects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Fredirects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Fredirects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Fredirects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Fredirects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invetica","download_url":"https://codeload.github.com/invetica/redirects/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Fredirects/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280365574,"owners_count":26318385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","http","redirects","ring"],"created_at":"2025-10-22T01:36:54.458Z","updated_at":"2025-10-22T01:36:58.826Z","avatar_url":"https://github.com/invetica.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+STARTUP: showall\n\n*Redirects* converts requests into redirects ensuring your traffic lands on your\ncanonical URL.\n\n#+BEGIN_HTML\n\u003ca href=\"https://circleci.com/gh/invetica/redirects\"\u003e\n  \u003cimg src=\"https://circleci.com/gh/invetica/redirects.svg\"\u003e\u003c/img\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://clojars.org/invetica/redirects\"\u003e\n  \u003cimg src=\"https://img.shields.io/clojars/v/invetica/redirects.svg\"\u003e\u003c/img\u003e\n\u003c/a\u003e\n#+END_HTML\n\n* Contents                                                              :TOC:\n- [[#usage][Usage]]\n- [[#license][License]]\n\n* Usage\n#+begin_src clojure\n  (ns app.service\n    (:require [invetica.redirects :as redirects]))\n\n  ;; Create a registry of hostnames you want to redirect to a canonical\n  ;; (optionally with HTTPS scheme) URL.\n  (def registry\n    (redirects/compile-sites\n     #{{:site/canonical \"www.example.com\"}\n       {:site/canonical \"www.invetica.co.uk\"\n        :site/aliases #{\"invetica.co.uk\"\n                        \"invetika.co.uk\"}\n        :site/https? true}}))\n\n  ;; Call `invetica.redirects/canonical-redirect` with your compiled registry, and\n  ;; the request map.\n  ;;\n  ;; If a redirect is needed, a Ring-compatible response map will be returned. If\n  ;; not, you'll get `nil` back.\n  (redirects/canonical-redirect\n   registry\n   {:headers {\"host\" \"example.com\"}\n    :query-string \"a=b\u0026c=d\"\n    :request-method :get\n    :scheme :http\n    :server-name \"example.com\"\n    :uri \"/foo\"})\n\n  ;; =\u003e {:status 302,\n  ;;     :headers {\"Location\" \"http://example.com/foo?a=b\u0026c=d\"}\n  ;;     :body \"\"}\n#+end_src\n\n* License\nThe MIT License (MIT)\n\nCopyright © 2017 Invetica Ltd\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvetica%2Fredirects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvetica%2Fredirects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvetica%2Fredirects/lists"}