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

Add initial http via lookup support #25

Merged
merged 1 commit into from
Nov 10, 2024
Merged

Conversation

mrchrisadams
Copy link
Member

This pull request introduces a new feature to handle 'via' HTTP headers in the FileFinder class and updates the corresponding tests. The changes include adding a method to check for 'via' headers, modifying the URI resolution logic to use this method, and adding new test cases to verify the functionality.

New Feature: Handling 'via' HTTP Headers

  • src/carbon_txt/finders.py: Added a new method _check_for_via_delegation to check for 'via' headers in the HTTP response and return the URL specified in the header if present.
  • src/carbon_txt/finders.py: Updated the resolve_uri method to use _check_for_via_delegation for handling 'via' headers and to raise an exception if the HTTP request fails.

Test Updates

  • tests/test_finders.py: Modified existing test cases to use variables for domain and URL strings for better readability.
  • tests/test_finders.py: Added a new test case test_looking_up_uri_with_delegation_using_via to verify that the resolve_uri method correctly follows the URL specified in the 'via' header.

@mrchrisadams mrchrisadams added this to the 1. Roquefort milestone Nov 10, 2024
@mrchrisadams mrchrisadams merged commit dd83624 into main Nov 10, 2024
6 checks passed
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.

1 participant