[][src]Crate actix_clean_path

Middleware to clean request's URI, and redirect if necessary.

Performs following:

  • Merges multiple / into one.
  • Resolves and eliminates .. and . if any.
  • Appends a trailing / if one is not present, and there is no file extension.

It will respond with a permanent redirect if the path was cleaned.

use actix_web::{web, App, HttpResponse};

let app = App::new()
    .wrap(actix_clean_path::CleanPath)
    .route("/", web::get().to(|| HttpResponse::Ok()));

Structs

CleanPath

Middleware to clean request's URI, and redirect if necessary. See module documenation for more.