-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookie Support #1146
Cookie Support #1146
Conversation
9d1968b
to
2ae9ac6
Compare
@@ -46,7 +46,7 @@ where | |||
let cache = params.cache; | |||
let accept = params.cfg.accept; | |||
|
|||
let pb = if params.cfg.no_progress { | |||
let pb = if params.cfg.no_progress || params.cfg.verbose.log_level() >= log::Level::Info { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is here, because showing the progress bar in verbose mode makes the output harder to read. It's not related to the other changes in this PR, but I got annoyed by the output while troubleshooting, so I fixed it in one go.
I am wondering if we should enable cookies by default. So if the user didn't set a custom cookie jar file, we still enable cookie support for this "link check session". After that, we throw the jar away. This would handle more cases, like #715. Opinions? |
Commit 14e7487 (cookie support lycheeverse#1146) re-introduced an unconditional dependency on the openssl-sys crate. That is, building Lychee with the Rustls TLS backend now requires OpenSSL. I suppose this change was unintended, maybe due to automatic conflict resolution. If not, please let me know. You can review the re-introduced dependency like so: ``` cargo tree --no-default-features --features rustls-tls -i openssl-sys ``` This commit puts the OpenSSL dependency behind the native-tls feature flag again. You can check the TLS features like so: ``` cargo check --workspace --all-targets --features vendored-openssl cargo check --workspace --all-targets --all-features cargo check --workspace --all-targets --no-default-features --features rustls-tls ``` Maybe this should be added to CI. But I don't want to waste anybody's time.
* Fix rustls-tls feature Commit 14e7487 (cookie support #1146) re-introduced an unconditional dependency on the openssl-sys crate. That is, building Lychee with the Rustls TLS backend now requires OpenSSL. I suppose this change was unintended, maybe due to automatic conflict resolution. If not, please let me know. You can review the re-introduced dependency like so: ``` cargo tree --no-default-features --features rustls-tls -i openssl-sys ``` This commit puts the OpenSSL dependency behind the native-tls feature flag again. You can check the TLS features like so: ``` cargo check --workspace --all-targets --features vendored-openssl cargo check --workspace --all-targets --all-features cargo check --workspace --all-targets --no-default-features --features rustls-tls ``` Maybe this should be added to CI. But I don't want to waste anybody's time. * Check feature flags during CI Adds a new CI job 'check-feature-flags' to verify the following: - Lychee with rustls-tls feature only doesn't depend on OpenSSL - Cargo check passes with default features - Cargo check passes with all features - Cargo check passes with rustls-tls feature only
This is a very conservative and limited implementation of cookie support.
The goal is to ship an MVP, which covers 80% of the use-cases.
When you run lychee with
--cookie-jar cookies.json
, all cookies will be stored incookies.json
, one cookie per line.This makes cookies easy to edit by hand if needed, although this is an advanced use-case and the API for the format is not guaranteed to be stable.
My initial goal was to use the same cookie file format that curl uses, but I backed away from this thought for a few reasons:
So, at least for now, we use reqwest_cookie_store under the hood.
Fixes: #645, #715
Partially fixes: #1108 (comment)
Reviews/feedback welcome!
Note: I had to change an unrelated unit test for invalid status codes, because it was flaky, and I wanted the CI pipeline to be green before merging.