hyperlane-plugin-rewrite 22.14.0

A high-performance HTTP URL rewrite and redirect plugin for the Hyperlane framework featuring canonical host/HTTPS enforcement (X-Forwarded-Proto aware), trailing-slash and duplicate-slash normalization, O(1) XxHash3_64 static tables, segment-bounded prefix rules, and compiled regex rules.
Documentation

hyperlane-plugin-rewrite

High-Performance HTTP URL Rewrite & Redirect Middleware Plugin

crates.io docs.rs Rust 2024 License: MIT

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, and RewriteHook (-102)
  • fn — Zero-allocation duplicate-slash check, host/proto extraction, CRLF-safe Location assembly, and segment-boundary prefix matching

Installation

cargo add hyperlane-plugin-rewrite

Verification

Run crate-scoped formatting, lint, and test gates from the workspace root:

cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p hyperlane-plugin-rewrite --all-features --all-targets -- -D warnings
cargo test -p hyperlane-plugin-rewrite --all-features

Documentation & Governance

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.