(value: &str)
| 273 | } |
| 274 | |
| 275 | fn parse_origin(value: &str) -> Option<Origin> { |
| 276 | if value.eq_ignore_ascii_case("null") { |
| 277 | return None; |
| 278 | } |
| 279 | let (scheme, rest) = value.split_once("://")?; |
| 280 | let authority_end = rest.find(['/', '?', '#']).unwrap_or(rest.len()); |
| 281 | parse_origin_authority(scheme, &rest[..authority_end]) |
| 282 | } |
| 283 | |
| 284 | fn parse_origin_authority(scheme: &str, authority: &str) -> Option<Origin> { |
| 285 | let scheme = scheme.to_ascii_lowercase(); |
no test coverage detected