Skip to content

Commit 2c9c3dd

Browse files
committed
fix: [#391] patch to identify 'torrent not found' tracker API response
1 parent 373493f commit 2c9c3dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tracker/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ async fn map_torrent_info_response(response: Response) -> Result<TorrentInfo, Se
184184
ServiceError::InternalServerError
185185
})?;
186186

187-
if body == *"torrent not known" {
187+
if body == "\"torrent not known\"" {
188188
// todo: temporary fix. the service should return a 404 (StatusCode::NOT_FOUND).
189189
return Err(ServiceError::TorrentNotFound);
190190
}
@@ -209,7 +209,7 @@ mod tests {
209209

210210
#[tokio::test]
211211
async fn it_should_return_a_torrent_not_found_response_when_the_tracker_returns_the_current_torrent_not_known_response() {
212-
let tracker_response = Response::new("torrent not known");
212+
let tracker_response = Response::new("\"torrent not known\"");
213213

214214
let result = map_torrent_info_response(tracker_response.into()).await.unwrap_err();
215215

0 commit comments

Comments
 (0)