Commit graph

1785 commits

Author SHA1 Message Date
katrinafyi
71e77f6255
fix comment for ErrorKind::InvalidFragment (#1775)
the comment doesn't make sense and it is identical to InvalidFilePath
which is right above it, so I reason this was a copy/paste mistake.
2025-07-27 14:17:49 +02:00
Thomas Zahner
ea415c8db4 Fix test 2025-07-26 17:33:02 +02:00
Thomas Zahner
c68e15fba3 Revert to previous behaviour: linking to directories results in Status::Ok(StatusCode::OK) 2025-07-26 17:33:02 +02:00
Thomas Zahner
0d25e524bf Remove JSON output files even on test failures 2025-07-26 17:33:02 +02:00
Thomas Zahner
08dabb06b2 Add regression test 2025-07-26 17:33:02 +02:00
Evan Read
8ec86dfee4
Add support for 64-bit ARM binary (#1774) 2025-07-25 12:06:15 +02:00
Thomas Zahner
e743ea3f5f Improve test 2025-07-18 16:53:08 +02:00
Thomas Zahner
8b70abc89b Make excluded_paths part of Collector instead of Input 2025-07-18 16:53:08 +02:00
Thomas Zahner
4bdf962698 Minor improvements 2025-07-18 16:53:08 +02:00
Thomas Zahner
23fbd0b0d5 Make regex field in RegexFilter private 2025-07-18 16:53:08 +02:00
Thomas Zahner
83025998c7 Add examples 2025-07-18 16:53:08 +02:00
Thomas Zahner
475d7f3d3a Apply clippy suggestions 2025-07-18 16:53:08 +02:00
Thomas Zahner
678acd9760 Test regex functionality in --exclude-path flag 2025-07-18 16:53:08 +02:00
Thomas Zahner
5036ce8388 Update flag description & clean up 2025-07-18 16:53:08 +02:00
Thomas Zahner
002fa49f29 Replace Vec<PathBuf> with dedicated PathExcludes type 2025-07-18 16:53:08 +02:00
Thomas Zahner
1de218a78a Unwrap option type 2025-07-18 16:53:08 +02:00
Keming
696a7cafc8
fix: do not check the fragment when http response err but accepted (#1763)
Signed-off-by: Keming <kemingy94@gmail.com>
2025-07-10 06:32:15 +02:00
Keming
068b4850d5
docs: add fallback_extensions to example config file (#1764)
Signed-off-by: Keming <kemingy94@gmail.com>
2025-07-10 00:03:51 +02:00
MichaIng
92a9bca23f
feat: skip fragment checking for unsupported MIME types (#1744)
* feat: skip fragment checking for unsupported MIME types

The remote URL/website checker currently passes all URLs with fragments to the fragment checker as HTML document, even if it is a different or unsupported MIME type. This can cause false fragment checking for Markdown documents, failures for other MIME types, especially binaries, and unnecessary traffic for large downloads, which are always finished completely, if the fragment checker is invoked.

This commit checks the Content-Type header of the response:
- Only if it is `text/html`, it is passed to the fragment checker as HTML type.
- Only if it is `text/markdown`, of `text/plain` and URL path ends on `.md`, it is passed to the fragment checker as Markdown type.
- In all other cases, the fragment checker is skipped and the HTTP status is returned.

To invoke the fragment checker with a variable document type, a new `FileType` argument is added to the `check_html_fragment()` function.

The fragment checker test and fixture are adjusted to match the expected result: checking a binary file via remote URL with fragment is now expected to succeed, since its Content-Type header does not invoke the fragment checker anymore.

Signed-off-by: MichaIng <micha@dietpi.com>

* Update fixtures/fragments/file1.md

Co-authored-by: MichaIng <micha@dietpi.com>

---------

Signed-off-by: MichaIng <micha@dietpi.com>
Co-authored-by: Matthias Endler <matthias@endler.dev>
2025-07-06 10:46:06 +02:00
Shawn
830ec2df85
Replace unmaintained human-sort with numeric-sort (#1759)
* Replace unmaintained human-sort with numeric-sort

human-sort is unmaintained and causes panic in recent Rust versions.
This commit replaces all usages of human_sort::compare with
numeric_sort::cmp to fix the 'total order' panic issue.

Fixes #1758
2025-07-04 23:00:03 +02:00
Keming
02f6f5cb49
feat: add 'user-content-' prefix to support github markdown fragment (#1750) 2025-07-04 22:58:47 +02:00
ocavue
81f2605118
fix: treat a fragment in an empty directory as an error (#1756)
* fix: treat a fragment in an empty directory as an error
* test: add more fragment tests
2025-07-04 10:25:57 +02:00
ocavue
6bcb37c2dc
fix: resolve index file inside a directory (#1752) 2025-07-03 16:55:57 +02:00
Thomas Zahner
845f74bab0
Fix basic auth (#1748)
* Capture bug as failing test

* Add basic auth credentials for website extraction requests via RequestChain & remove headers from Input

* Create UrlExtractor and add back headers

* Improve UrlExtractor

* Fix bug: extend headers instead of setting them

* Clean up

* Minor adjustments

* Apply suggestions from code review

Co-authored-by: Matthias Endler <matthias@endler.dev>

* Mention in doc comment how the method might panic

* Remove use of chain for more simplicity

---------

Co-authored-by: Matthias Endler <matthias@endler.dev>
2025-07-03 13:45:30 +02:00
Thomas Zahner
6a471a42cc Update 'Users' section in the README 2025-07-03 09:33:03 +02:00
ocavue
837f4419ba Add ProseKit to users 2025-07-03 09:29:53 +02:00
Thomas Zahner
8f2f746bf9
Migrate to Clippy 1.88 (#1749)
* Update flake
* Fix clippy's new suggestions
* Do not ignore tests any longer since they work by now
* Add ignore reason
2025-06-27 12:34:48 +02:00
MichaIng
140f70167c test: fix assertion in fragment checks
Signed-off-by: MichaIng <micha@dietpi.com>
2025-06-25 11:18:01 +02:00
Thomas Zahner
34ec9b3d48 Replace unreliable API URL 2025-06-25 11:10:39 +02:00
Thomas Zahner
1935e52279
docs: improve lychee.example.toml (lycheeverse#1699) (#1741)
Signed-off-by: Sebastian Davids <sdavids@gmx.de>
Co-authored-by: Sebastian Davids <sdavids@gmx.de>
2025-06-21 20:59:34 +02:00
Allen Hernandez
bbfb8b0b96
display unsupported URLs (#1727)
* display status for unsupported URLs

* updates screengrab

---------

Co-authored-by: Allen Hernandez <2349718+AllenSH12@users.noreply.github.com>
2025-06-20 17:52:15 +02:00
MichaIng
b970256248
fix: skip fragment check if website URL doesn't contain fragment (#1733)
* fix: skip fragment check if website URL doesn't contain fragment

Signed-off-by: MichaIng <micha@dietpi.com>

* test: add tests for fragment checks with binary data

Signed-off-by: MichaIng <micha@dietpi.com>

* fix: skip fragment checking as well if fragment is empty

`is_some()` is true as well if the fragment is given but empty, i.e. `#`. While it is an edge case, skip the fragment checker as well in case of an empty fragment.

Signed-off-by: MichaIng <micha@dietpi.com>

* test: switch to lycheeverse/master remote URLs

Signed-off-by: MichaIng <micha@dietpi.com>

* fix: apply rustfmt annotation

Signed-off-by: MichaIng <micha@dietpi.com>

---------

Signed-off-by: MichaIng <micha@dietpi.com>
2025-06-20 17:47:35 +02:00
tooomm
83fe1248c4
Add xml schema found in xsd files to list of exclusions (#1735)
* Add xml schema found in xsd files
See e.g. https://www.w3schools.com/xml/schema_intro.asp
* escape dots in urls
2025-06-20 15:38:49 +02:00
Trask Stalnaker
d1c651a469
Fix docker tagging for release versions (#1738) 2025-06-20 15:35:04 +02:00
Matthias Endler
3592972d64
chore: release v0.19.1 (#1726) 2025-06-16 14:56:32 +03:00
Keming
d512262ffa
fix: skip the fragment check if the uri doesn't contain fragment (#1730)
Signed-off-by: Keming <kemingy94@gmail.com>
2025-06-16 14:46:01 +03:00
Thomas Zahner
b46cb5c02e
Don't echo potentially sensitive header data (#1728)
* Don't echo potentially sensitive header data
* Still show header name, for more user-friendliness
2025-06-12 17:08:15 +02:00
Thomas Zahner
469ccd0089 Update changelog 2025-06-11 16:44:23 +02:00
Matthias Endler
639c74e392 chore: release v0.19.0 2025-06-11 16:04:34 +02:00
Thomas Zahner
99ec1e7c07 Keep supporting 'latest' in CI Dockerfiles 2025-06-11 14:04:21 +02:00
Thomas Zahner
a11efce06d Follow renaming: latest -> nightly 2025-06-11 12:28:47 +02:00
Thomas Zahner
4797339b6a Follow renaming: latest -> nightly 2025-06-11 12:21:00 +02:00
Thomas Zahner
e59456b96e Add cli test 2025-06-11 11:19:51 +02:00
Thomas Zahner
f0a4b3a5a8 Add explanation 2025-06-11 11:19:51 +02:00
Thomas Zahner
4a8587665f Fix grammar
Co-authored-by: Matthias Endler <matthias@endler.dev>
2025-06-11 11:19:51 +02:00
Thomas Zahner
622bc6956f Update docs 2025-06-11 11:19:51 +02:00
Thomas Zahner
326f119e38 Extract DEFAULT_ACCEPTED_STATUS_CODES & apply clippy's suggestions 2025-06-11 11:19:51 +02:00
Thomas Zahner
74961d2470 Use StatusCodeSelector default as default accepted StatusCodes 2025-06-11 11:19:51 +02:00
Thomas Zahner
c2a0908747 Tiny improvements 2025-06-11 11:19:51 +02:00
Thomas Zahner
286ff50612 Remove dbg macro 2025-06-11 11:19:51 +02:00