Skip to content

Commit

Permalink
chore(shoot): [closes #22] ignore danger certs // dns
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnwriter committed Nov 2, 2023
1 parent 4e7dffa commit fc52b80
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 8 deletions.
136 changes: 136 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ categories = ["accessibility", "web-programming", "command-line" ]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
url = "2.4.1"
reqwest = { version = "0.11.22", default-features = false, features = ["rustls-tls"] }
tokio = { version = "1.33.0", features = ["full"] }
chromiumoxide = { version = "0.5.4", features = ["tokio-runtime"], default-features = false }
futures = "0.3.28"
reqwest = { version = "0.11.22", default-features = false, features = ["rustls-tls", "trust-dns"] }
clap = { version = "4.4.6", features = ["derive", "string"] }
tokio = { version = "1.33.0", features = ["full"] }
futures = "0.3.28"
columns = "0.1.0"
colored = "2.0.4"
anyhow = "1.0.75"
url = "2.4.1"

[profile.dev]
opt-level = 0
Expand Down
14 changes: 10 additions & 4 deletions src/cli/screenshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,15 @@ async fn take_screenshot(
silent: bool,
) -> anyhow::Result<()> {
let parsed_url = Url::parse(&url)?;
let res = time::timeout(
let client = reqwest::Client::builder()
.danger_accept_invalid_certs(true)
.http1_ignore_invalid_headers_in_responses(true)
.trust_dns(true)
.build()?;

let response = time::timeout(
Duration::from_secs(timeout),
reqwest::get(parsed_url.clone()),
client.get(parsed_url.clone()).send(),
)
.await
.context(format!("[-] Timed out URL = {url}"))??;
Expand All @@ -156,10 +162,10 @@ async fn take_screenshot(

if !silent {
match page.get_title().await {
Ok(Some(title)) => show_info(url.clone(), title, res.status()),
Ok(Some(title)) => show_info(url.clone(), title, response.status()),
_ => {
let title = "No title".to_string();
show_info(url.clone(), title, res.status());
show_info(url.clone(), title, response.status());
}
}
}
Expand Down

0 comments on commit fc52b80

Please sign in to comment.