Skip to content

Add custom User-Agent for HTTP requests#2234

Open
syedzohaibshah wants to merge 2 commits intoaboutcode-org:mainfrom
syedzohaibshah:add-custom-useragent
Open

Add custom User-Agent for HTTP requests#2234
syedzohaibshah wants to merge 2 commits intoaboutcode-org:mainfrom
syedzohaibshah:add-custom-useragent

Conversation

@syedzohaibshah
Copy link
Copy Markdown

@syedzohaibshah syedzohaibshah commented Mar 26, 2026

Fixes #410
Partially addresses #591

Changes

  • Added VULNERABLECODE_USER_AGENT constant in utils.py
  • Created get_http_headers() helper function
  • Updated fetch_yaml(), fetch_response(), and requests_with_5xx_retry() to use custom User-Agent
  • Updated 6 importers: openssl, apache_httpd, suse_oval, suse_backports, debian_oval, ubuntu

Why

Some sites block requests with Python's default User-Agent. This properly identifies VulnerableCode scrapers and is a first step toward centralizing all network access (#591).

Testing

  • Verified all modified files compile without errors
  • Changes follow existing code patterns

Zohaib Shah and others added 2 commits March 26, 2026 16:00
Signed-off-by: Zohaib Shah <zs3783999@gmail.com>

Signed-off-by: Zohaib Shah <zohaib@Zohaibs-MacBook-Pro.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vulnerablecode useragent

1 participant