File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ services:
44 build :
55 context : .
66 dockerfile : ./dockerfiles/Dockerfile
7+ platform : linux/amd64
78 depends_on :
89 - db
910 - s3
@@ -34,6 +35,7 @@ services:
3435 build :
3536 context : ./dockerfiles
3637 dockerfile : ./Dockerfile-postgres
38+ platform : linux/amd64
3739 volumes :
3840 - postgres-data:/var/lib/postgresql/data
3941 environment :
@@ -50,6 +52,7 @@ services:
5052
5153 s3 :
5254 image : minio/minio
55+ platform : linux/amd64
5356 entrypoint : >
5457 /bin/sh -c "
5558 mkdir -p /data/rust-docs-rs;
@@ -77,6 +80,7 @@ services:
7780 retries : 10
7881
7982 prometheus :
83+ platform : linux/amd64
8084 build :
8185 context : ./dockerfiles
8286 dockerfile : ./Dockerfile-prometheus
Original file line number Diff line number Diff line change @@ -46,12 +46,19 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult<Response> {
4646 permanent : bool ,
4747 path_in_crate : Option < & str > ,
4848 ) -> IronResult < Response > {
49- if let Some ( query) = req. url . query ( ) {
50- url_str. push ( '?' ) ;
51- url_str. push_str ( query) ;
52- } else if let Some ( path) = path_in_crate {
49+ let mut question_mark = false ;
50+ if let Some ( path) = path_in_crate {
5351 url_str. push_str ( "?search=" ) ;
5452 url_str. push_str ( path) ;
53+ question_mark = true ;
54+ }
55+ if let Some ( query) = req. url . query ( ) {
56+ if !question_mark {
57+ url_str. push ( '?' ) ;
58+ } else {
59+ url_str. push ( '&' ) ;
60+ }
61+ url_str. push_str ( query) ;
5562 }
5663 let url = ctry ! ( req, Url :: parse( & url_str) ) ;
5764 let ( status_code, max_age) = if permanent {
@@ -1776,6 +1783,11 @@ mod test {
17761783 "/some_random_crate/latest/some_random_crate/?search=some::path" ,
17771784 web,
17781785 ) ?;
1786+ assert_redirect (
1787+ "/some_random_crate::some::path?go_to_first=true" ,
1788+ "/some_random_crate/latest/some_random_crate/?search=some::path&go_to_first=true" ,
1789+ web,
1790+ ) ?;
17791791
17801792 assert_redirect (
17811793 "/std::some::path" ,
You can’t perform that action at this time.
0 commit comments