Skip to content

Inconsistent User-Agent Strings in Extension Downloader #175

@Meghraj-100

Description

@Meghraj-100

Description

The ExtensionDownloader class in src/extension_shield/core/extension_downloader.py defines two separate User-Agent strings with conflicting Chrome version numbers:

  • _get_chrome_headers() at line 29 returns Chrome/131.0.0.0
  • Class variable CHROME_USER_AGENT at line 58 uses Chrome/118.0.0.0

The _download() method at line 82 references the class constant, leaving _get_chrome_headers() as dead code that is never called anywhere in the codebase. Additionally, a CHROME_VERSION environment variable at line 48 introduces a third potential value, creating a three-way inconsistency.

Impact

  • The outdated User-Agent (Chrome/118) may cause Google to return HTML error pages or 204 responses instead of valid CRX files
  • Dead code adds maintenance burden
  • Three-way inconsistency increases risk of future bugs when only one value is updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report or bug fix related work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions