File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -476,8 +476,8 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
476476 } ;
477477
478478 let permalink_path = format ! (
479- "/crate/ {}/{}{}{}" ,
480- name, latest_version, target_redirect , query_string
479+ "/{}/{}/ {}{}" ,
480+ name, latest_version, inner_path , query_string
481481 ) ;
482482
483483 let latest_path = format ! ( "/crate/{}/latest{}{}" , name, target_redirect, query_string) ;
@@ -834,7 +834,7 @@ mod test {
834834 let body = String :: from_utf8 ( resp. bytes ( ) . unwrap ( ) . to_vec ( ) ) . unwrap ( ) ;
835835 assert ! ( body. contains( "<a href=\" /crate/dummy/latest/source/\" " ) ) ;
836836 assert ! ( body. contains( "<a href=\" /crate/dummy/latest\" " ) ) ;
837- assert ! ( body. contains( "<a href=\" /crate/ dummy/0.1.0/target-redirect/x86_64-unknown-linux-gnu /dummy/index.html\" " ) ) ;
837+ assert ! ( body. contains( "<a href=\" /dummy/0.1.0/dummy/index.html\" " ) ) ;
838838 Ok ( ( ) )
839839 } )
840840 }
Original file line number Diff line number Diff line change 241241 if ( document . location . hash != "" ) {
242242 permalink . href += "#" + document . location . hash ;
243243 }
244- // Note: It would be nicer to do history.replaceState here and avoid a page load
245- // (that's what GitHub does), but the permalink goes through a redirect, so you wind up
246- // with a weird URL like:
247- // http://localhost:3000/crate/regex/1.3.1/target-redirect/x86_64-unknown-linux-gnu/regex/index.html
248- permalink . click ( ) ;
244+ history . replaceState ( { } , null , permalink . href ) ;
249245 }
250246 } ) ;
251247} ) ( ) ;
You can’t perform that action at this time.
0 commit comments