Redirect to URL with canonical info-hash#281
Merged
josecelano merged 3 commits intotorrust:developfrom Sep 13, 2023
josecelano:issue-278-redirect-to-canonical-infohash
Merged
Redirect to URL with canonical info-hash#281josecelano merged 3 commits intotorrust:developfrom josecelano:issue-278-redirect-to-canonical-infohash
josecelano merged 3 commits intotorrust:developfrom
josecelano:issue-278-redirect-to-canonical-infohash
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #281 +/- ##
===========================================
- Coverage 43.65% 43.56% -0.10%
===========================================
Files 77 77
Lines 4240 4320 +80
===========================================
+ Hits 1851 1882 +31
- Misses 2389 2438 +49
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Member
Author
|
I found a bug while adding the tests for the download torrent endpoint. |
Member
Author
Member
Author
|
ACK 2a73f10 |
For endpoints using a GET param with an infohash: - GET /v1/torrent/CANONICAL_INFO_HASH - GET /v1/torrent/download/CANONICAL_INFO_HASH Suppose the URL contains an info-hash, which is not canonical but belongs to a canonical info-hash group. In that case, the response will be a redirection (307) to the same URL but using the canonical info-hash.
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.
For endpoints using a GET param with an infohash:
GET /v1/torrent/INFO_HASHGET /v1/torrent/download/INFO_HASHThat param must be the canonical infohash so far. This PR allows users to use the original info-hash.
Suppose the URL contains an info-hash, which is not canonical but belongs to a canonical info-hash group. In that case, the response will be a redirection (307) to the same URL but using the canonical info-hash.
Subtasks
Canonical Infohash Group.