MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / sanitized

Method sanitized

rust/src/stats.rs:65–81  ·  view source on GitHub ↗

browser, arch and selenium_version are already bounded upstream (unrecognized browsers error out, arch is bucketed by get_normalized_arch, selenium_version is the crate version). os, browser_version and language_binding still carry raw CLI/env input here, so they are constrained to a vetted vocabulary before being reported to Plausible.

(
        browser: &str,
        browser_version: &str,
        os: &str,
        arch: &str,
        language_binding: &str,
        selenium_version: &str,
    )

Source from the content-addressed store, hash-verified

63 // os, browser_version and language_binding still carry raw CLI/env input here, so they are
64 // constrained to a vetted vocabulary before being reported to Plausible.
65 pub fn sanitized(
66 browser: &str,
67 browser_version: &str,
68 os: &str,
69 arch: &str,
70 language_binding: &str,
71 selenium_version: &str,
72 ) -> Self {
73 Props {
74 browser: browser.to_ascii_lowercase(),
75 browser_version: sanitize_browser_version(browser_version),
76 os: sanitize_os(os),
77 arch: arch.to_ascii_lowercase(),
78 lang: sanitize_language_binding(language_binding),
79 selenium_version: selenium_version.to_ascii_lowercase(),
80 }
81 }
82}
83
84fn sanitize_os(os: &str) -> String {

Callers

nothing calls this directly

Calls 3

sanitize_browser_versionFunction · 0.85
sanitize_osFunction · 0.85

Tested by

no test coverage detected