{"id":51921309,"url":"https://github.com/ym-project/actix-passthrough-headers","last_synced_at":"2026-07-27T19:00:48.178Z","repository":{"id":368438250,"uuid":"1205774369","full_name":"ym-project/actix-passthrough-headers","owner":"ym-project","description":"Middleware for actix-web to passthrough headers","archived":false,"fork":false,"pushed_at":"2026-04-09T09:26:20.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"v4","last_synced_at":"2026-06-30T16:18:15.799Z","etag":null,"topics":["actix-web","headers","middleware","passthrough"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ym-project.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":"2026-04-09T09:07:46.000Z","updated_at":"2026-04-09T09:31:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ym-project/actix-passthrough-headers","commit_stats":null,"previous_names":["ym-project/actix-passthrough-headers"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ym-project/actix-passthrough-headers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ym-project%2Factix-passthrough-headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ym-project%2Factix-passthrough-headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ym-project%2Factix-passthrough-headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ym-project%2Factix-passthrough-headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ym-project","download_url":"https://codeload.github.com/ym-project/actix-passthrough-headers/tar.gz/refs/heads/v4","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ym-project%2Factix-passthrough-headers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35961441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-27T02:00:06.776Z","response_time":101,"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":["actix-web","headers","middleware","passthrough"],"created_at":"2026-07-27T19:00:47.439Z","updated_at":"2026-07-27T19:00:48.169Z","avatar_url":"https://github.com/ym-project.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Actix-passthrough-headers\n\nMiddleware to passthrough headers. It will be useful when you want to pass header from request to\nresponse without changes.\n\n## Installation\n\n```bash\ncargo add actix-passthrough-headers\n```\n\n## Usage\n\n```rs\nApp::new().wrap(PassthroughHeaders::new(vec![\"X-Request-Id\"]))\n```\n\n## Options\n\nBy default when route returns some header:\n\n```rs\nasync fn route() -\u003e HttpResponse {\n\tHttpResponse::Ok()\n\t\t.insert_header((\"X-Request-Id\", \"2\"))\n\t\t.finish()\n}\n```\n\nAnd the same header was passed to middleware:\n\n```rs\nApp::new().wrap(PassthroughHeaders::new([\"X-Request-Id\"]))\n```\n\nThe middleware ignores route's header and returns initial header value. It means when http request\nhas header `X-Request-Id: 1` and route returns `X-Request-Id: 2`, response header will be\n`X-Request-Id: 1`.\n\n### Method preserve_response_headers()\n\nMethod `preserve_response_headers` disallow to rewrite route's headers. It means when http request\nhas header `X-Request-Id: 1` and route returns `X-Request-Id: 2`, response header will be\n`X-Request-Id: 2`.\n\n```rs\nApp::new().wrap(PassthroughHeaders::new(vec![\"X-Request-Id\"]).preserve_response_headers())\n```\n\n## Examples\n\n### Simple Example\n\n```rs\nuse actix_web::{App, HttpServer};\nuse actix_passthrough_headers::PassthroughHeaders;\n\n#[actix_web::main]\nasync fn main() {\n\tHttpServer::new(|| {\n\t\tApp::new().wrap(PassthroughHeaders::new(vec![\"X-Request-Id\"]))\n\t})\n\t\t.bind((\"127.0.0.1\", 8080)).unwrap()\n\t\t.run()\n\t\t.await;\n}\n```\n\n### Preserve response headers example\n\n```rs\nuse actix_web::{App, HttpServer};\nuse actix_passthrough_headers::PassthroughHeaders;\n\nasync fn route() -\u003e HttpResponse {\n\tHttpResponse::Ok().insert_header((\"X-Request-Id\", \"1\")).finish()\n}\n\n#[actix_web::main]\nasync fn main() {\n\tHttpServer::new(|| {\n\t\tApp::new()\n\t\t\t.wrap(PassthroughHeaders::new(vec![\"X-Request-Id\"]).preserve_response_headers())\n\t\t\t.route(\"/\", web::get().to(route))\n\t})\n\t\t.bind((\"127.0.0.1\", 8080)).unwrap()\n\t\t.run()\n\t\t.await;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fym-project%2Factix-passthrough-headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fym-project%2Factix-passthrough-headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fym-project%2Factix-passthrough-headers/lists"}