Skip to content

Commit

Permalink
Add support for relative links (#1489)
Browse files Browse the repository at this point in the history
This commit introduces several improvements to the file checking process and URI handling:

- Extract file checking logic into separate `Checker` structs (`FileChecker`, `WebsiteChecker`, `MailChecker`)
- Improve handling of relative and absolute file paths
- Enhance URI parsing and creation from file paths
- Refactor `create_request` function for better clarity and error handling

These changes provide better support for resolving relative links, handling different base URLs, and working with file paths.

Fixes #1296 and #1480
  • Loading branch information
mre committed Oct 27, 2024
1 parent be3321b commit 70b6ab7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lychee-bin/src/formatters/response/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ mod tests {
}
}

#[cfg(test)]
/// Helper function to strip ANSI color codes for tests
fn strip_ansi_codes(s: &str) -> String {
console::strip_ansi_codes(s).to_string()
}

#[test]
fn test_format_status() {
let status = Status::Ok(StatusCode::OK);
Expand Down
1 change: 0 additions & 1 deletion lychee-bin/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,6 @@ mod cli {

// Clean up
fs::remove_file(&cache_file)?;

Ok(())
}

Expand Down

0 comments on commit 70b6ab7

Please sign in to comment.