{"id":20091400,"url":"https://github.com/tejasbubane/rack_custom_headers","last_synced_at":"2026-06-08T19:32:08.012Z","repository":{"id":145488495,"uuid":"168520579","full_name":"tejasbubane/rack_custom_headers","owner":"tejasbubane","description":"Rack middleware for easily adding custom headers","archived":false,"fork":false,"pushed_at":"2019-02-11T07:53:48.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T09:51:26.327Z","etag":null,"topics":["rack-middleware","rails","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/tejasbubane.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-31T12:21:00.000Z","updated_at":"2019-02-11T07:53:49.000Z","dependencies_parsed_at":"2023-03-25T09:31:14.776Z","dependency_job_id":null,"html_url":"https://github.com/tejasbubane/rack_custom_headers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tejasbubane/rack_custom_headers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejasbubane%2Frack_custom_headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejasbubane%2Frack_custom_headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejasbubane%2Frack_custom_headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejasbubane%2Frack_custom_headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tejasbubane","download_url":"https://codeload.github.com/tejasbubane/rack_custom_headers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejasbubane%2Frack_custom_headers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34078019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["rack-middleware","rails","ruby"],"created_at":"2024-11-13T16:31:51.745Z","updated_at":"2026-06-08T19:32:07.988Z","avatar_url":"https://github.com/tejasbubane.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rack_custom_headers\n\n[![Build Status](https://travis-ci.org/tejasbubane/rack_custom_headers.svg?branch=master)](https://travis-ci.org/tejasbubane/rack_custom_headers)\n\nCustom headers for your rack app.\n\nThis simple rack middleware will allow you to easily add custom headers to your request/response.\n\n## Installation\n\n```ruby\ngem 'rack_custom_headers'\n```\n\n## Usage\n\n#### Rails apps\n\nIn `config/application.rb`:\n\n```\nconfig.middleware.use Rack::CustomHeaders \u003chash options with headername and generator proc\u003e\n```\n\neg.\n\n```ruby\nconfig.middleware.use Rack::CustomHeaders, \"X-Trace-ID\" =\u003e -\u003e { SecureRandom.hex(10) }, \"X-Foo\" =\u003e -\u003e :default\n```\n\nRefer [docs](https://guides.rubyonrails.org/rails_on_rack.html#configuring-middleware-stack) for more details.\n\n#### Non-Rails apps\n\nIn `config.ru`:\n\n```ruby\nuse Rack::RequestID \u003chash options same as above\u003e\n```\n\n### Config\n\n* Headers will only be added. If header already present, it will **not** be overridden.\n\n* A config hash is mandatory to be passed in `use` otherwise nothing will be added.\n\n* Config hash should be of the format `\"header-name\" =\u003e -\u003e { ... }` or `\"header-name\" =\u003e :default`.\n\n* When symbol `:default` is passed instead of proc, a new `UUID` will be generated and added.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftejasbubane%2Frack_custom_headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftejasbubane%2Frack_custom_headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftejasbubane%2Frack_custom_headers/lists"}