Skip to content

Commit 564ef13

Browse files
committed
fix: [#628] bug, duplicate slash in tracker announce URL
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
1 parent 96269cd commit 564ef13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tracker/service.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ impl Service {
376376
/// It builds the announce url appending the user tracker key.
377377
/// Eg: <https://tracker:7070/USER_TRACKER_KEY>
378378
fn announce_url_with_key(&self, tracker_key: &TrackerKey) -> Url {
379-
Url::parse(&format!("{}/{}", self.tracker_url, tracker_key.key)).unwrap()
379+
self.tracker_url
380+
.join(&tracker_key.key)
381+
.expect("a tracker key should be added to the tracker base URL")
380382
}
381383

382384
fn invalid_token_body() -> String {

0 commit comments

Comments
 (0)