{"id":15994119,"url":"https://github.com/knutwalker/cors-play","last_synced_at":"2025-08-03T19:14:13.507Z","repository":{"id":13976923,"uuid":"16677674","full_name":"knutwalker/cors-play","owner":"knutwalker","description":"Easy CORS support for Play","archived":false,"fork":false,"pushed_at":"2014-02-23T14:14:11.000Z","size":188,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-09T00:07:04.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knutwalker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-09T22:38:02.000Z","updated_at":"2015-02-19T15:21:24.000Z","dependencies_parsed_at":"2022-07-31T17:09:03.958Z","dependency_job_id":null,"html_url":"https://github.com/knutwalker/cors-play","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/knutwalker/cors-play","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutwalker%2Fcors-play","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutwalker%2Fcors-play/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutwalker%2Fcors-play/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutwalker%2Fcors-play/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knutwalker","download_url":"https://codeload.github.com/knutwalker/cors-play/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutwalker%2Fcors-play/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265738481,"owners_count":23820162,"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","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":[],"created_at":"2024-10-08T07:06:11.823Z","updated_at":"2025-07-18T10:07:31.427Z","avatar_url":"https://github.com/knutwalker.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CORS Play\n\n[![Build Status](https://travis-ci.org/knutwalker/cors-play.png?branch=master\u00261)](https://travis-ci.org/knutwalker/cors-play)\n[![Coverage Status](https://coveralls.io/repos/knutwalker/cors-play/badge.png?branch=master\u00261)](https://coveralls.io/r/knutwalker/cors-play?branch=master)\n\n\nEasy CORS integration for Play:\n\n - use CORS with your Playframework application\n - No additional controllers or routes required\n\n\n## Installation\n\n### Stable Version\n\nAdd this to your play build/sbt\n\n    libraryDependencies ++= Seq(\n      \"de.knutwalker\" %% \"cors-play\" % \"0.1.0\"\n    )\n\n### Snapshot Version\n\n    resolvers += \"Sonatype snapshots\" at \"http://oss.sonatype.org/content/repositories/snapshots/\"\n\n    libraryDependencies ++= Seq(\n      \"de.knutwalker\" %% \"cors-play\" % \"0.1.1-SNAPSHOT\"\n    )\n\n\n## Usage\n\nYou have to mixin the `CorsSupport` trait into your `Global` object\n\n```scala\nimport de.knutwalker.play.cors.{ CorsStrategy, CorsSupport }\nimport play.api.GlobalSettings\n\nobject Global extends GlobalSettings with CorsSupport {\n\n  override val corsStrategy = CorsStrategy.Everyone\n}\n```\n\nYou can choose different a `CorsStrategy` to customize the behavior\n\n`CorsStrategy` | Behaviour\n-------------- | -------------\n`Everyone`     | Allow every request, event malformed (not CORS) ones\n`Origin`       | Allow requests with the `Origin` header set. For valid CORS requests, this is the same as `Everyone`.\n`NoOne`        | Do not allow any requests\n`Localhost`    | Only allow requests from localhost\n`Localhost([ports])`   | Only allow requests from localhost that originate from a given list of ports\n`Fixed([origins])`     | Provide a fixed set of allowed origins. This results in white-listing behaviour on the browser-side (as the origins are sent as is)\n`WhiteList([origins])` | Provide a white list of origins, that are allow to make a CORS request. The list is resolved on server-side, only the white-listed origin is sent in the header.\n`BlackList([origins])` | Provide a black list of origins, that are *not* allowed to make CORS requests. The list is resolved on server-side, only the not-black-listed origin is sent in the header.\n`Satisfies(handler)`    | Define a custom check, that return `true` for allowed requests, and `false` otherwise. (Sent origin will be `*`)\n`Satisfies(handler).allowing(origin)` | Define a custom check, that return `true` for allowed requests, and `false` otherwise. (Sent origin will be `origin`)\n`Satisfies(handler).withOrigin`       | Define a custom check, that return `true` for allowed requests, and `false` otherwise. (Sent origin will be the value from the `Origin` header)\n`CustomPF(handler)`   | Define a custom check as a partial function, that will match and return an origin for allowed requests, and won't match otherwise\n`Custom(handler)`     | Define a custom check, that will return `Some(origin)` for allowed requests, and `None` otherwise.\n\n\n### License\n\nThis software is released under the MIT Licence\n\nhttp://knutwalker.mit-license.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknutwalker%2Fcors-play","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknutwalker%2Fcors-play","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknutwalker%2Fcors-play/lists"}