Add option to change user agent and a cookie to send verified requests to Cloudflare protected websites.#91
Open
grous0 wants to merge 4 commits intothebuildcraft:mainfrom
Open
Add option to change user agent and a cookie to send verified requests to Cloudflare protected websites.#91grous0 wants to merge 4 commits intothebuildcraft:mainfrom
grous0 wants to merge 4 commits intothebuildcraft:mainfrom
Conversation
Signed-off-by: Ömer Ferhat Şenel <grousee@proton.me>
Signed-off-by: Ömer Ferhat Şenel <grousee@proton.me>
Author
|
Messes up with the versions below 1.19.2 thing. idk why it did that probably IntelliJ "cleanup". |
Signed-off-by: Ömer Ferhat Şenel <grousee@proton.me>
Owner
|
Sorry for the late reply. I currently don't have time to completely review, test, compile and release it. Once my exams are over I will work on this :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a simple change to fix #90 but temporarily. It adds 2 options user agent and a field for cf_clearance cookie.
This does not use CookieManager because it adds extra complexity for just 1 cookie. If project ever needs to have more than 1 cookie (for example a cookie list option might be added) consider changing to CookieManager.
cf_clearance cookie has a life span of 6 months (at least that's what Cloudflare says when adding the cookie) so after 6 months cookie must be renewed.
This change is only tested in 1.21.10 Fabric. I didn't tested it for other versions or mod loaders because it is 1:00 AM...
Another solution is introducing something like Selenium to actually solve the Cloudflare challenge inside the mod. But this introduces lot more complexity and dependency.
Locales: