Skip to content

Commit 289ce2a

Browse files
committed
fix(hyperlink): Trust user on absolute paths
This makes it harder to construct URLs across windows/linux
1 parent c11f10a commit 289ce2a

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

  • crates/anstyle-hyperlink/src

crates/anstyle-hyperlink/src/file.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ pub fn path_to_url(path: &std::path::Path) -> Option<String> {
2020
/// the computer you've SSH'ed into
2121
/// ([reference](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#file-uris-and-the-hostname))
2222
pub fn file_to_url(hostname: Option<&str>, path: &std::path::Path) -> Option<String> {
23-
if !path.is_absolute() {
24-
return None;
25-
}
26-
2723
let mut url = "file://".to_owned();
2824
if let Some(hostname) = hostname {
2925
url.push_str(hostname);

0 commit comments

Comments
 (0)