Skip to content

Redirects aren't reported for rejected status codes #2011

@katrinafyi

Description

@katrinafyi
echo '[a](http://github.com/lycheeverse/lychee/issues/fdsjakf)' > a.md
cargo run -- a.md -v --format markdown   

This redirects http to https but the output doesn't mention of redirects because the final status is 404.

* [404] <http://github.com/lycheeverse/lychee/issues/fdsjakf> | Rejected status code (this depends on your "accept" configuration): Not Found

You can see that there is actually a redirect happening:

$ curl -I http://github.com/lycheeverse/issues/fdsjakf        
HTTP/1.1 301 Moved Permanently
Content-Length: 0
Location: https://github.com/lycheeverse/issues/fdsjakf

This is compared to a redirect leading to 200:

* [200] <http://github.com/lycheeverse/lychee/issues/2000> | Redirect: Followed 1 redirect resolving to the final status of: OK. Redirects: http://github.com/lycheeverse/lychee/issues/2000 --[301]--> https://github.com/lycheeverse/lychee/issues/2000

It would be nice if the redirects would always be reported, independently of the final status code.

Kind of related to #1958. If the redirects were reported, that issue would've been easier to debug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions