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> {
476
476
} ;
477
477
478
478
let permalink_path = format ! (
479
- "/crate/ {}/{}{}{}" ,
480
- name, latest_version, target_redirect , query_string
479
+ "/{}/{}/ {}{}" ,
480
+ name, latest_version, inner_path , query_string
481
481
) ;
482
482
483
483
let latest_path = format ! ( "/crate/{}/latest{}{}" , name, target_redirect, query_string) ;
@@ -834,7 +834,7 @@ mod test {
834
834
let body = String :: from_utf8 ( resp. bytes ( ) . unwrap ( ) . to_vec ( ) ) . unwrap ( ) ;
835
835
assert ! ( body. contains( "<a href=\" /crate/dummy/latest/source/\" " ) ) ;
836
836
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\" " ) ) ;
838
838
Ok ( ( ) )
839
839
} )
840
840
}
Original file line number Diff line number Diff line change 241
241
if ( document . location . hash != "" ) {
242
242
permalink . href += "#" + document . location . hash ;
243
243
}
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 ) ;
249
245
}
250
246
} ) ;
251
247
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments