1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-30 08:24:28 +02:00

Use askama-escape for html escaping (#1953)

This commit is contained in:
Jens Reidel
2021-02-07 05:50:23 +01:00
committed by GitHub
parent 9eaea6a2fd
commit 50309aa295
3 changed files with 6 additions and 3 deletions

View File

@ -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 {
// " -- &quot; & -- &amp; ' -- &#x27; < -- &lt; > -- &gt; / -- &#x2f;
macro_rules! encode_file_name {
($entry:ident) => {
escape_html_entity(&$entry.file_name().to_string_lossy())
escape_html_entity(&$entry.file_name().to_string_lossy(), Html)
};
}