From f6a76c14ea34be1513cb010747702424c5b1d597 Mon Sep 17 00:00:00 2001 From: Juan Aguilar Santillana Date: Mon, 11 Oct 2021 18:58:00 +0200 Subject: [PATCH] Replace askama_escape in favor of v_htmlescape --- actix-files/CHANGES.md | 2 +- actix-files/Cargo.toml | 2 +- actix-files/src/directory.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actix-files/CHANGES.md b/actix-files/CHANGES.md index 6d1512c22..c7ed20d33 100644 --- a/actix-files/CHANGES.md +++ b/actix-files/CHANGES.md @@ -1,7 +1,7 @@ # Changes ## Unreleased - 2021-xx-xx - +* Replace `askama_escape` with `v_htmlescape` ## 0.6.0-beta.7 - 2021-09-09 * Minimum supported Rust version (MSRV) is now 1.51. diff --git a/actix-files/Cargo.toml b/actix-files/Cargo.toml index eccf49a77..cccb6ab2c 100644 --- a/actix-files/Cargo.toml +++ b/actix-files/Cargo.toml @@ -20,7 +20,6 @@ actix-http = "3.0.0-beta.10" actix-service = "2.0.0" actix-utils = "3.0.0" -askama_escape = "0.10" bitflags = "1" bytes = "1" futures-core = { version = "0.3.7", default-features = false, features = ["alloc"] } @@ -30,6 +29,7 @@ log = "0.4" mime = "0.3" mime_guess = "2.0.1" percent-encoding = "2.1" +v_htmlescape = "0.14" [dev-dependencies] actix-rt = "2.2" diff --git a/actix-files/src/directory.rs b/actix-files/src/directory.rs index 80e0c98d0..772e3946f 100644 --- a/actix-files/src/directory.rs +++ b/actix-files/src/directory.rs @@ -1,8 +1,8 @@ use std::{fmt::Write, fs::DirEntry, io, path::Path, path::PathBuf}; use actix_web::{dev::ServiceResponse, HttpRequest, HttpResponse}; -use askama_escape::{escape as escape_html_entity, Html}; use percent_encoding::{utf8_percent_encode, CONTROLS}; +use v_htmlescape::escape as escape_html_entity; /// A directory; responds with the generated directory listing. #[derive(Debug)] @@ -50,7 +50,7 @@ macro_rules! encode_file_url { // " -- " & -- & ' -- ' < -- < > -- > / -- / macro_rules! encode_file_name { ($entry:ident) => { - escape_html_entity(&$entry.file_name().to_string_lossy(), Html) + escape_html_entity(&$entry.file_name().to_string_lossy()) }; }