File tree 2 files changed +20
-4
lines changed
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ services:
4
4
build :
5
5
context : .
6
6
dockerfile : ./dockerfiles/Dockerfile
7
+ platform : linux/amd64
7
8
depends_on :
8
9
- db
9
10
- s3
@@ -34,6 +35,7 @@ services:
34
35
build :
35
36
context : ./dockerfiles
36
37
dockerfile : ./Dockerfile-postgres
38
+ platform : linux/amd64
37
39
volumes :
38
40
- postgres-data:/var/lib/postgresql/data
39
41
environment :
@@ -50,6 +52,7 @@ services:
50
52
51
53
s3 :
52
54
image : minio/minio
55
+ platform : linux/amd64
53
56
entrypoint : >
54
57
/bin/sh -c "
55
58
mkdir -p /data/rust-docs-rs;
@@ -77,6 +80,7 @@ services:
77
80
retries : 10
78
81
79
82
prometheus :
83
+ platform : linux/amd64
80
84
build :
81
85
context : ./dockerfiles
82
86
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> {
46
46
permanent : bool ,
47
47
path_in_crate : Option < & str > ,
48
48
) -> 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 {
53
51
url_str. push_str ( "?search=" ) ;
54
52
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) ;
55
62
}
56
63
let url = ctry ! ( req, Url :: parse( & url_str) ) ;
57
64
let ( status_code, max_age) = if permanent {
@@ -1776,6 +1783,11 @@ mod test {
1776
1783
"/some_random_crate/latest/some_random_crate/?search=some::path" ,
1777
1784
web,
1778
1785
) ?;
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
+ ) ?;
1779
1791
1780
1792
assert_redirect (
1781
1793
"/std::some::path" ,
You can’t perform that action at this time.
0 commit comments