{"id":13400260,"url":"https://github.com/rack/rack-contrib","last_synced_at":"2025-05-14T00:06:05.097Z","repository":{"id":471119,"uuid":"96088","full_name":"rack/rack-contrib","owner":"rack","description":"Contributed Rack Middleware and Utilities","archived":false,"fork":false,"pushed_at":"2024-07-05T19:45:43.000Z","size":449,"stargazers_count":1258,"open_issues_count":1,"forks_count":221,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-10-29T11:22:38.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2008-12-24T00:03:51.000Z","updated_at":"2024-10-26T21:40:39.000Z","dependencies_parsed_at":"2023-07-05T14:56:25.206Z","dependency_job_id":"aebf8f1c-2ac8-4795-ae21-bd8786241ee0","html_url":"https://github.com/rack/rack-contrib","commit_stats":{"total_commits":342,"total_committers":87,"mean_commits":"3.9310344827586206","dds":0.8596491228070176,"last_synced_commit":"d5265bc4f849f4bf55b230d3a0929e513acd5fac"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rack%2Frack-contrib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rack%2Frack-contrib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rack%2Frack-contrib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rack%2Frack-contrib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rack","download_url":"https://codeload.github.com/rack/rack-contrib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247953857,"owners_count":21024102,"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-07-30T19:00:50.012Z","updated_at":"2025-04-09T01:21:59.080Z","avatar_url":"https://github.com/rack.png","language":"Ruby","funding_links":["https://tidelift.com/security"],"categories":["Ruby","General"],"sub_categories":[],"readme":"# Contributed Rack Middleware and Utilities\n\nThis package includes a variety of add-on components for Rack, a Ruby web server\ninterface:\n\n* `Rack::Access` - Limits access based on IP address\n* `Rack::Backstage` - Returns content of specified file if it exists, which makes it convenient for putting up maintenance pages.\n* `Rack::BounceFavicon` - Returns a 404 for requests to `/favicon.ico`\n* `Rack::CSSHTTPRequest` - Adds CSSHTTPRequest support by encoding responses as CSS for cross-site AJAX-style data loading\n* `Rack::Callbacks` - Implements DSL for pure before/after filter like Middlewares.\n* `Rack::Cookies` - Adds simple cookie jar hash to env\n* `Rack::Deflect` - Helps protect against DoS attacks.\n* `Rack::Evil` - Lets the rack application return a response to the client from any place.\n* `Rack::HostMeta` - Configures `/host-meta` using a block\n* `Rack::JSONBodyParser` - Adds JSON request bodies to the Rack parameters hash.\n* `Rack::JSONP` - Adds JSON-P support by stripping out the callback param and padding the response with the appropriate callback format.\n* `Rack::LazyConditionalGet` - Caches a global `Last-Modified` date and updates it each time there is a request that is not `GET` or `HEAD`.\n* `Rack::LighttpdScriptNameFix` - Fixes how lighttpd sets the `SCRIPT_NAME` and `PATH_INFO` variables in certain configurations.\n* `Rack::Locale` - Detects the client locale using the Accept-Language request header and sets a `rack.locale` variable in the environment.\n* `Rack::MailExceptions` - Rescues exceptions raised from the app and sends a useful email with the exception, stacktrace, and contents of the environment.\n* `Rack::NestedParams` - parses form params with subscripts (e.g., * \"`post[title]=Hello`\") into a nested/recursive Hash structure (based on Rails' implementation).\n* `Rack::NotFound` - A default 404 application.\n* `Rack::PostBodyContentTypeParser` - [Deprecated]: Adds support for JSON request bodies. The Rack parameter hash is populated by deserializing the JSON data provided in the request body when the Content-Type is application/json\n* `Rack::Printout` - Prints the environment and the response per request\n* `Rack::ProcTitle` - Displays request information in process title (`$0`) for monitoring/inspection with ps(1).\n* `Rack::Profiler` - Uses ruby-prof to measure request time.\n* `Rack::RelativeRedirect` - Transforms relative paths in redirects to absolute URLs.\n* `Rack::ResponseCache` - Caches responses to requests without query strings to Disk or a user provided Ruby object. Similar to Rails' page caching.\n* `Rack::ResponseHeaders` - Manipulates response headers object at runtime\n* `Rack::Signals` - Installs signal handlers that are safely processed after a request\n* `Rack::SimpleEndpoint` - Creates simple endpoints with routing rules, similar to Sinatra actions\n* `Rack::StaticCache` - Modifies the response headers to facilitiate client and proxy caching for static files that minimizes http requests and improves overall load times for second time visitors.\n* `Rack::TimeZone` - Detects the client's timezone using JavaScript and sets a variable in Rack's environment with the offset from UTC.\n* `Rack::TryStatic` - Tries to match request to a static file\n\n### Use\n\nGit is the quickest way to the rack-contrib sources:\n\n    git clone git://github.com/rack/rack-contrib.git\n\nGems are available too:\n\n    gem install rack-contrib\n\nRequiring `'rack/contrib'` will add autoloads to the Rack modules for all of the\ncomponents included. The following example shows what a simple rackup\n(`config.ru`) file might look like:\n\n```ruby\nrequire 'rack'\nrequire 'rack/contrib'\n\nuse Rack::Profiler if ENV['RACK_ENV'] == 'development'\n\nuse Rack::ETag\nuse Rack::MailExceptions\n\nrun theapp\n```\n\n#### Versioning\n\nThis package is [semver compliant](https://semver.org); you should use a\npessimistic version constraint (`~\u003e`) against the relevant `2.x` version of\nthis gem.\n\nThis version of `rack-contrib` is compatible with `rack` 2.x and 3.x.  If you\nare using `rack` 1.x, you will need to use `rack-contrib` 1.x.  A suitable\npessimistic version constraint (`~\u003e`) is recommended.\n\n\n### Testing\n\nTo contribute to the project, begin by cloning the repo and installing the necessary gems:\n\n    gem install bundler\n    bundle install\n\nTo run the entire test suite, run:\n\n    bundle exec rake test\n\nTo run a specific component's tests, use the `TEST` environment variable:\n\n    TEST=test/spec_rack_thecomponent.rb bundle exec rake test\n\n### Criteria for inclusion\nThe criteria for middleware being included in this project are roughly as follows:\n* For patterns that are very common, provide a reference implementation so that other projects do not have to reinvent the wheel.\n* For patterns that are very useful or interesting, provide a well-done implementation.\n* The middleware fits in 1 code file and is relatively small. Currently all middleware in the project are \u003c 150 LOC.\n* The middleware doesn't have any dependencies other than rack and the ruby standard library.\n\nThese criteria were introduced several years after the start of the project, so some of the included middleware may not meet all of them. In particular, several middleware have external dependencies. It is possible that in some future release of rack-contrib, middleware with external depencies will be removed from the project.\n\nWhen submitting code keep the above criteria in mind and also see the code\nguidelines in CONTRIBUTING.md.\n\n### Links\n\n* rack-contrib on GitHub:: \u003chttps://github.com/rack/rack-contrib\u003e\n* Rack:: \u003chttps://rack.github.io/\u003e\n* Rack On GitHub:: \u003chttps://github.com/rack/rack\u003e\n\n\n### Security Reporting\n\nTo report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frack%2Frack-contrib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frack%2Frack-contrib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frack%2Frack-contrib/lists"}