{"id":19133611,"url":"https://github.com/hashload/horse-cors","last_synced_at":"2026-02-20T19:04:09.225Z","repository":{"id":103679670,"uuid":"151461831","full_name":"HashLoad/horse-cors","owner":"HashLoad","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-14T14:52:58.000Z","size":43,"stargazers_count":47,"open_issues_count":2,"forks_count":14,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-09-30T06:32:06.533Z","etag":null,"topics":["cors","horse","middleware"],"latest_commit_sha":null,"homepage":null,"language":"Pascal","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/HashLoad.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-10-03T18:37:14.000Z","updated_at":"2025-09-02T09:50:35.000Z","dependencies_parsed_at":"2025-05-31T13:24:03.134Z","dependency_job_id":"65e21198-53e5-484b-ac37-3a82eb275839","html_url":"https://github.com/HashLoad/horse-cors","commit_stats":{"total_commits":22,"total_committers":5,"mean_commits":4.4,"dds":0.6363636363636364,"last_synced_commit":"930bab7ea06003c53d115a1453e7b929ca5c0bce"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/HashLoad/horse-cors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-cors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-cors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-cors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-cors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HashLoad","download_url":"https://codeload.github.com/HashLoad/horse-cors/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-cors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018120,"owners_count":26086280,"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-14T02:00:06.444Z","response_time":60,"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":["cors","horse","middleware"],"created_at":"2024-11-09T06:23:06.695Z","updated_at":"2025-10-14T06:11:23.305Z","avatar_url":"https://github.com/HashLoad.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# horse-cors\n\u003cb\u003ehorse-cors\u003c/b\u003e is an official middleware for handling CORS in APIs developed with the \u003ca href=\"https://github.com/HashLoad/horse\"\u003eHorse\u003c/a\u003e framework.\n\u003cbr\u003eWe created a channel on Telegram for questions and support:\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://t.me/hashload\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/telegram-join%20channel-7289DA?style=flat-square\"\u003e\n\u003c/a\u003e\n\n## ❓ What's CORS?\nCross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources. CORS also relies on a mechanism by which browsers make a \"preflight\" request to the server hosting the cross-origin resource, in order to check that the server will permit the actual request. In that preflight, the browser sends headers that indicate the HTTP method and headers that will be used in the actual request.\n\nAn example of a cross-origin request: the front-end JavaScript code served from `https://domain-a.com` uses XMLHttpRequest to make a request for `https://domain-b.com/data.json`.\n\nFor security reasons, browsers restrict cross-origin HTTP requests initiated from scripts. For example, XMLHttpRequest and the Fetch API follow the same-origin policy. This means that a web application using those APIs can only request resources from the same origin the application was loaded from unless the response from other origins includes the right CORS headers.\n\nThe CORS mechanism supports secure cross-origin requests and data transfers between browsers and servers. Modern browsers use CORS in APIs such as XMLHttpRequest or Fetch to mitigate the risks of cross-origin HTTP requests.\n\nRead more in [https://developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)\n\n## ⚙️ Installation\nInstallation is done using the [`boss install`](https://github.com/HashLoad/boss) command:\n``` sh\nboss install horse-cors\n```\nIf you choose to install manually, simply add the following folders to your project, in *Project \u003e Options \u003e Resource Compiler \u003e Directories and Conditionals \u003e Include file search path*\n```\n../horse-cors/src\n```\n\n## ✔️ Compatibility\nThis middleware is compatible with projects developed in:\n- [X] Delphi\n- [X] Lazarus\n\n## ⚡️ Quickstart Delphi\n```delphi\nuses\n  Horse,\n  Horse.CORS, // It's necessary to use the unit\n  System.SysUtils;\n\nbegin\n  // You can configure CORS as in the example below:\n\n  // HorseCORS\n  //   .AllowedOrigin('*')\n  //   .AllowedCredentials('true')\n  //   .AllowedHeaders('*')\n  //   .AllowedMethods('*')\n  //   .ExposedHeaders('*');\n\n  // It's necessary to add the middleware in the Horse:\n  THorse.Use(CORS);\n\n  THorse.Get('/ping',\n    procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)\n    begin\n      Res.Send('pong');\n    end);\n\n  THorse.Listen(9000);\nend.\n```\n\n## ⚡️ Quickstart Lazarus\n```delphi\n{$MODE DELPHI}{$H+}\n\nuses\n  {$IFDEF UNIX}{$IFDEF UseCThreads}\n  cthreads,\n  {$ENDIF}{$ENDIF}\n  Horse,\n  Horse.CORS, // It's necessary to use the unit\n  SysUtils;\n\nprocedure GetPing(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);\nbegin\n  Res.Send('Pong');\nend;\n\nbegin\n  // You can configure CORS as in the example below:\n\n  // HorseCORS\n  //   .AllowedOrigin('*')\n  //   .AllowedCredentials('true')\n  //   .AllowedHeaders('*')\n  //   .AllowedMethods('*')\n  //   .ExposedHeaders('*');\n\n  // It's necessary to add the middleware in the Horse:\n  THorse.Use(CORS);\n\n  THorse.Get('/ping', GetPing);\n\n  THorse.Listen(9000);\nend.\n```\n\n## ⚠️ License\n`horse-cors` is free and open-source middleware licensed under the [MIT License](https://github.com/HashLoad/horse-cors/blob/master/LICENSE). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashload%2Fhorse-cors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashload%2Fhorse-cors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashload%2Fhorse-cors/lists"}