From d0edde7e06992406fa893c8ce88c315b6333500a Mon Sep 17 00:00:00 2001 From: Axel Chalon Date: Thu, 3 May 2018 18:44:13 +0200 Subject: [PATCH 1/2] Remove inject.js server-side injection for dapps --- dapps/src/page/handler.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/dapps/src/page/handler.rs b/dapps/src/page/handler.rs index a4bd6d71b3e..687c8e1e52c 100644 --- a/dapps/src/page/handler.rs +++ b/dapps/src/page/handler.rs @@ -17,9 +17,8 @@ use std::io; use std::time::{Duration, SystemTime}; use hyper::{self, header, StatusCode}; -use hyper::mime::{self, Mime}; +use hyper::mime::{Mime}; -use apps; use handlers::{Reader, ContentHandler, add_security_headers}; use {Embeddable}; @@ -98,18 +97,7 @@ impl PageHandler { add_security_headers(&mut headers, self.safe_to_embed_on, self.allow_js_eval); } - let initial_content = if file.content_type().to_owned() == mime::TEXT_HTML { - let content = &format!( - r#""#, - apps::UTILS_PATH, - ); - - content.as_bytes().to_vec() - } else { - Vec::new() - }; - - let (reader, body) = Reader::pair(file.into_reader(), initial_content); + let (reader, body) = Reader::pair(file.into_reader(), Vec::new()); res.set_body(body); (Some(reader), res) } From 60ff6e16471190a9fe08978794f8e66c6d5e19bd Mon Sep 17 00:00:00 2001 From: Axel Chalon Date: Wed, 9 May 2018 17:04:04 +0200 Subject: [PATCH 2/2] Remove dapps test `should_inject_js` Parity doesn't inject a "#), - true, - "Expected inject script tag in: {}", - response.body - ); - assert_security_headers(&response.headers); -}