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 59e4fd4 commit 986b87dCopy full SHA for 986b87d
src/views.rs
@@ -350,7 +350,10 @@ impl EncodableCrate {
350
};
351
352
// Match documentation URL host against blocked host array elements
353
- if DOCUMENTATION_BLOCKLIST.contains(&url_host) {
+ if DOCUMENTATION_BLOCKLIST
354
+ .iter()
355
+ .any(|blocked| url_host.ends_with(blocked))
356
+ {
357
None
358
} else {
359
Some(url)
@@ -897,4 +900,14 @@ mod tests {
897
900
898
901
);
899
902
}
903
+
904
+ #[test]
905
+ fn documentation_blocked_subdomain() {
906
+ assert_eq!(
907
+ EncodableCrate::remove_blocked_documentation_urls(Some(String::from(
908
+ "http://www.rust-ci.org/crate/crate-0.1/doc/crate-0.1",
909
+ ),),),
910
+ None
911
+ );
912
+ }
913
0 commit comments