()
| 156 | |
| 157 | #[cfg(not(feature = "mock"))] |
| 158 | fn current_page_path() -> Option<String> { |
| 159 | let window = web_sys::window()?; |
| 160 | let location = window.location(); |
| 161 | let mut path = location.pathname().ok().unwrap_or_else(|| "/".to_string()); |
| 162 | if path.trim().is_empty() { |
| 163 | path = "/".to_string(); |
| 164 | } |
| 165 | let search = location.search().ok().unwrap_or_default(); |
| 166 | let hash = location.hash().ok().unwrap_or_default(); |
| 167 | if !search.is_empty() { |
| 168 | path.push_str(&search); |
| 169 | } |
| 170 | if !hash.is_empty() { |
| 171 | path.push_str(&hash); |
| 172 | } |
| 173 | Some(path) |
| 174 | } |
| 175 | |
| 176 | #[cfg(not(feature = "mock"))] |
| 177 | fn with_behavior_headers(mut builder: RequestBuilder) -> RequestBuilder { |
no test coverage detected