Skip to content

remove fake user agent #873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/idom/web/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def resolve_module_exports_from_url(
return set()

try:
text = requests.get(url, headers={"User-Agent": _FAKE_USER_AGENT}).text
text = requests.get(url).text
except requests.exceptions.ConnectionError as error:
reason = "" if error is None else " - {error.errno}"
logger.warning("Did not resolve exports for url " + url + reason)
Expand Down Expand Up @@ -155,8 +155,3 @@ def _resolve_relative_url(base_url: str, rel_url: str) -> str:
_JS_GENERAL_EXPORT_PATTERN = re.compile(
r"(?:^|;|})\s*export(?=\s+|{)(.*?)(?=;|$)", re.MULTILINE
)

# we fake the user agent to bypass some bot blockers
_FAKE_USER_AGENT = (
"Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion"
)