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,
)
| 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 | |
| 84 | fn sanitize_os(os: &str) -> String { |
nothing calls this directly
no test coverage detected