Skip to main content

normalize_romm_origin

Function normalize_romm_origin 

Source
pub fn normalize_romm_origin(url: &str) -> String
Expand description

Normalizes a RomM site URL by trimming whitespace, trailing slashes, and removing the /api suffix.

ยงExamples

assert_eq!(normalize_romm_origin("http://localhost:8080/api/"), "http://localhost:8080");
assert_eq!(normalize_romm_origin(" https://romm.example.com "), "https://romm.example.com");