lycheeverse / lychee

⚡ Fast, async, stream-based link checker written in Rust. Finds broken URLs and mail addresses inside Markdown, HTML, reStructuredText, websites and more!
https://lychee.cli.rs
Apache License 2.0
2.22k stars 134 forks source link

Documentation for headers in TOML #1507

Closed devin-purple closed 1 month ago

devin-purple commented 1 month ago

The CLI argument works (--header "Host=something.com")

I cannot find anywhere in the documentation that shows how to put this into the lychee.toml

In the example it just shows headers = [] which is not helpful.

mre commented 1 month ago

Have you tried this?

headers = ["Host=something.com"]
mre commented 1 month ago

You might be running into https://github.com/lycheeverse/lychee/issues/1441#issuecomment-2170424574

devin-purple commented 1 month ago

I've tried headers = ["Host=asldkfjasldfkj.com"] in .toml, does not seem to work. I should get all 400s with a bad hostname.

Maybe related to #1441, I am reading a list of links from a local file and sending a custom header.

mre commented 1 month ago

I'm beginning to think header parsing from the config is broken. Maybe it never worked.

cc-stjm commented 1 month ago

I've just come across this - I think you have to specify

header = ["foo=bar"]

in the .toml

the documentation has

headers= ["foo=bar"]

(Note plural)

mre commented 1 month ago

Aha! Thanks for the feedback. Would you like to open a pull request to fix the documentation?