File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ impl CratesfyiHandler {
103103 router. get ( "/robots.txt" , sitemap:: robots_txt_handler, "robots_txt" ) ;
104104 router. get ( "/sitemap.xml" , sitemap:: sitemap_handler, "sitemap_xml" ) ;
105105 router. get ( "/opensearch.xml" , opensearch_xml_handler, "opensearch_xml" ) ;
106+ router. get ( "/std" , rustdoc:: std_redirector_handler, "std" ) ;
106107 router. get ( "/releases" , releases:: recent_releases_handler, "releases" ) ;
107108 router. get ( "/releases/feed" ,
108109 releases:: releases_feed_handler,
Original file line number Diff line number Diff line change @@ -66,6 +66,12 @@ impl ToJson for RustdocPage {
6666}
6767
6868
69+ /// Handler called for the `/std`. Redirects to the official standard library docs.
70+ pub fn std_redirector_handler ( _req : & mut Request ) -> IronResult < Response > {
71+ let url = Url :: parse ( "https://doc.rust-lang.org/stable/std/" ) . unwrap ( ) ;
72+ Ok ( Response :: with ( ( status:: Found , Redirect ( url) ) ) )
73+ }
74+
6975/// Handler called for `/:crate` and `/:crate/:version` URLs. Automatically redirects to the docs
7076/// or crate details page based on whether the given crate version was successfully built.
7177pub fn rustdoc_redirector_handler ( req : & mut Request ) -> IronResult < Response > {
You can’t perform that action at this time.
0 commit comments