Add initial http via lookup support #25
Merged
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 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 theresolve_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 casetest_looking_up_uri_with_delegation_using_via
to verify that theresolve_uri
method correctly follows the URL specified in the 'via' header.