Skip to content

Commit

Permalink
fix: [#628] bug, duplicate slash in tracker announce URL
Browse files Browse the repository at this point in the history
Runnint the tracker in private mode the announce URL in the torrent file
should be:

http://tracker:7070/TRACKER_USER_KEY

instead of:

http://tracker:7070//TRACKER_USER_KEY
  • Loading branch information
josecelano committed Jun 11, 2024
1 parent 96269cd commit 564ef13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tracker/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ impl Service {
/// It builds the announce url appending the user tracker key.
/// Eg: <https://tracker:7070/USER_TRACKER_KEY>
fn announce_url_with_key(&self, tracker_key: &TrackerKey) -> Url {
Url::parse(&format!("{}/{}", self.tracker_url, tracker_key.key)).unwrap()
self.tracker_url
.join(&tracker_key.key)
.expect("a tracker key should be added to the tracker base URL")
}

fn invalid_token_body() -> String {
Expand Down

0 comments on commit 564ef13

Please sign in to comment.