We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9a1774 commit 4886465Copy full SHA for 4886465
src/web/rustdoc.rs
@@ -34,7 +34,7 @@ use axum::{
34
http::StatusCode,
35
response::{IntoResponse, Response as AxumResponse},
36
};
37
-use http::{HeaderValue, Uri, header};
+use http::{HeaderValue, Uri, header, uri::Authority};
38
use serde::Deserialize;
39
use std::{
40
collections::HashMap,
@@ -231,7 +231,9 @@ pub(crate) async fn rustdoc_redirector_handler(
231
232
233
if let Some(original_uri) = original_uri
234
- && original_uri.path() == original_uri.path()
+ && original_uri.path() == url.path()
235
+ && (url.authority().is_none()
236
+ || url.authority() == Some(&Authority::from_static("docs.rs")))
237
{
238
return Err(anyhow!(
239
"infinite redirect detected, \noriginal_uri = {}, redirect_url = {}",
0 commit comments