From c0499819beba09cea1249afb5d0b04bbfd8c277a Mon Sep 17 00:00:00 2001 From: imnyang Date: Sat, 7 Jun 2025 00:05:46 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B8=8C=EB=9D=BC=EC=9A=B0=EC=A0=80=20?= =?UTF-8?q?=ED=97=A4=EB=8D=94=20=EC=84=A4=EC=A0=95=EC=9D=84=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0=ED=95=98=EA=B3=A0=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=EC=97=90=EC=9D=B4=EC=A0=84=ED=8A=B8=EB=A5=BC=20=EC=97=85?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=8A=B8=ED=96=88=EC=8A=B5=EB=8B=88=EB=8B=A4?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- is-html-fast/src/main.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/is-html-fast/src/main.rs b/is-html-fast/src/main.rs index 1d014d3..78822d9 100644 --- a/is-html-fast/src/main.rs +++ b/is-html-fast/src/main.rs @@ -6,7 +6,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use rayon::prelude::*; use reqwest::blocking::Client; -use reqwest::header::{CONTENT_TYPE, USER_AGENT}; +use reqwest::header::{HeaderMap, HeaderValue, CONTENT_TYPE, USER_AGENT, ACCEPT, ACCEPT_LANGUAGE, ACCEPT_ENCODING, CONNECTION, UPGRADE_INSECURE_REQUESTS}; fn main() -> Result<(), Box> { let input_file = File::open("domains.txt")?; @@ -27,10 +27,19 @@ fn main() -> Result<(), Box> { let output = Arc::new(Mutex::new(output_file)); + // 브라우저 헤더 세팅 + let mut headers = HeaderMap::new(); + headers.insert(USER_AGENT, HeaderValue::from_static("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0")); + headers.insert(ACCEPT, HeaderValue::from_static("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")); + headers.insert(ACCEPT_LANGUAGE, HeaderValue::from_static("ko,en-US;q=0.7,en;q=0.3")); + headers.insert(ACCEPT_ENCODING, HeaderValue::from_static("gzip, deflate, br")); + headers.insert(CONNECTION, HeaderValue::from_static("keep-alive")); + headers.insert(UPGRADE_INSECURE_REQUESTS, HeaderValue::from_static("1")); + let client = Arc::new( Client::builder() .timeout(Duration::from_secs(5)) - .user_agent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0") + .default_headers(headers) .build()?, );