1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 00:21:08 +01:00

Improve change askama_escape in favor of v_htmlescape (#651)

This commit is contained in:
Juan Aguilar 2019-01-03 20:34:18 +01:00 committed by Douman
parent 61883042c2
commit 55a2a59906
3 changed files with 8 additions and 3 deletions

View File

@ -64,7 +64,7 @@ cell = ["actix-net/cell"]
actix = "0.7.9" actix = "0.7.9"
actix-net = "0.2.6" actix-net = "0.2.6"
askama_escape = "0.1.0" v_htmlescape = "0.3.2"
base64 = "0.10" base64 = "0.10"
bitflags = "1.0" bitflags = "1.0"
failure = "^0.1.2" failure = "^0.1.2"

View File

@ -11,7 +11,7 @@ use std::{cmp, io};
#[cfg(unix)] #[cfg(unix)]
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
use askama_escape::{escape as escape_html_entity}; use v_htmlescape::HTMLEscape;
use bytes::Bytes; use bytes::Bytes;
use futures::{Async, Future, Poll, Stream}; use futures::{Async, Future, Poll, Stream};
use futures_cpupool::{CpuFuture, CpuPool}; use futures_cpupool::{CpuFuture, CpuPool};
@ -569,6 +569,11 @@ macro_rules! encode_file_url {
}; };
} }
#[inline]
fn escape_html_entity(s: &str) -> HTMLEscape {
HTMLEscape::from(s)
}
// " -- &quot; & -- &amp; ' -- &#x27; < -- &lt; > -- &gt; / -- &#x2f; // " -- &quot; & -- &amp; ' -- &#x27; < -- &lt; > -- &gt; / -- &#x2f;
macro_rules! encode_file_name { macro_rules! encode_file_name {
($entry:ident) => { ($entry:ident) => {

View File

@ -100,7 +100,6 @@ extern crate failure;
extern crate lazy_static; extern crate lazy_static;
#[macro_use] #[macro_use]
extern crate futures; extern crate futures;
extern crate askama_escape;
extern crate cookie; extern crate cookie;
extern crate futures_cpupool; extern crate futures_cpupool;
extern crate http as modhttp; extern crate http as modhttp;
@ -137,6 +136,7 @@ extern crate serde_urlencoded;
extern crate percent_encoding; extern crate percent_encoding;
extern crate serde_json; extern crate serde_json;
extern crate smallvec; extern crate smallvec;
extern crate v_htmlescape;
extern crate actix_net; extern crate actix_net;
#[macro_use] #[macro_use]