hyperlane-plugin-rewrite
High-Performance HTTP URL Rewrite & Redirect Middleware Plugin
Workspace Overview · Plugin Catalog · API Docs
Overview
Opt-in request middleware (order -102) providing canonical host & HTTPS upgrade redirects (X-Forwarded-Proto and RFC 7239 Forwarded aware), duplicate-slash collapsing, trailing-slash normalization (Strip/Enforce), O(1) XxHash3_64 static exact redirect/rewrite tables, segment-bounded prefix strip/rewrite rules, and precompiled regex rules supporting both short-circuit HTTP redirects (301/302/307/308) and internal Request::set_path rewrites.
This crate is a member of the hyperlane unified Rust 2024 workspace. All plugin crates are opt-in and transparent (Status::Continue) when unconfigured.
Responsibilities & Module Layout
struct/enum/impl—RewriteConfig,RedirectStatus,RewriteAction,TrailingSlashMode,CompiledRewrite,RewritePlugin, andRewriteHook(-102)fn— Zero-allocation duplicate-slash check, host/proto extraction, CRLF-safeLocationassembly, and segment-boundary prefix matching
Installation
Verification
Run crate-scoped formatting, lint, and test gates from the workspace root:
Documentation & Governance
- Project standards and release workflows live in
../../.agents/skills/hyperlane/SKILL.md.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For inquiries, please contact the author at root@devhub.vip.