Merge pull request #48 from Y2Z/ignore-empty-iframes
Ignore iframes with empty src
This commit is contained in:
commit
1c6f7a495f
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "monolith"
|
name = "monolith"
|
||||||
version = "2.0.14"
|
version = "2.0.15"
|
||||||
authors = [
|
authors = [
|
||||||
"Sunshine <sunshine@uberspace.net>",
|
"Sunshine <sunshine@uberspace.net>",
|
||||||
"Mahdi Robatipoor <mahdi.robatipoor@gmail.com>",
|
"Mahdi Robatipoor <mahdi.robatipoor@gmail.com>",
|
||||||
|
@ -287,7 +287,14 @@ pub fn walk_and_embed_assets(
|
|||||||
"iframe" => {
|
"iframe" => {
|
||||||
for attr in attrs_mut.iter_mut() {
|
for attr in attrs_mut.iter_mut() {
|
||||||
if &attr.name.local == "src" {
|
if &attr.name.local == "src" {
|
||||||
let src_full_url: String = resolve_url(&url, &attr.value.to_string())
|
let value = attr.value.to_string();
|
||||||
|
// Ignore iframes with empty source (they cause infinite loops)
|
||||||
|
if value == EMPTY_STRING.clone() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let src_full_url: String = resolve_url(&url, &value)
|
||||||
.unwrap_or(EMPTY_STRING.clone());
|
.unwrap_or(EMPTY_STRING.clone());
|
||||||
let iframe_data = retrieve_asset(
|
let iframe_data = retrieve_asset(
|
||||||
&src_full_url,
|
&src_full_url,
|
||||||
|
Loading…
Reference in New Issue
Block a user