Skip to content
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

[rollback] Rollback request_fingerprint #278

Merged
merged 3 commits into from
May 31, 2023

Conversation

LuckyPigeon
Copy link
Collaborator

Description

request_fingerprint is about to deprecate, but the new fingerprint has a different implementation. So I think we should rollback to the request_fingerprint for the moment, and implement our own request_fingerprint later, follow the old request_fingerprint settings.

Fixes #275

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • pytest
  • [] Other test (please specify)

Test Configuration:

  • OS version: Window10
  • Necessary Libraries (optional):

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Owner

@rmax rmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@LuckyPigeon LuckyPigeon merged commit d839392 into rmax:master May 31, 2023
2 of 7 checks passed
@devfox-se
Copy link

devfox-se commented Jun 3, 2023

How's the new implementation not sufficient for scrapy-redis?

@LuckyPigeon
Copy link
Collaborator Author

First of all, new implementation returns bytes instead of string.
Second, I hadn't checked what's the difference between new and old implementations. To protect the master branch, I had to rollback the request_fingerprint for the moment.

@LuckyPigeon
Copy link
Collaborator Author

LuckyPigeon commented Jun 3, 2023

Now, I've checked the implementation and make a new PR, please refer to #280.
The new fingerprint implementation from Scrapy contains a lot of checks and proccesses for headers and keep_fragments,
which isn't what we need, we only need to process request and generate fingerprint, thus, I think we should implement our own fingerprint function, a simple one would be just fine.

You still can pass request into new fingerprint then add hex() at the result of fingerprint to get a string result at your own implementation, in that case, you can pass headers and keep_fragments as your parameters as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants