File tree 2 files changed +17
-12
lines changed
2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -2,19 +2,9 @@ import Route from '@ember/routing/route';
2
2
import { inject as service } from '@ember/service' ;
3
3
4
4
export default Route . extend ( {
5
- fastboot : service ( ) ,
5
+ redirector : service ( ) ,
6
6
7
7
redirect ( ) {
8
- this . _redirectTo ( 'https://doc.rust-lang.org/cargo/getting-started/installation.html' ) ;
9
- } ,
10
-
11
- _redirectTo ( url ) {
12
- if ( this . fastboot . isFastBoot ) {
13
- let headers = this . fastboot . response . headers ;
14
- headers . set ( 'location' , url ) ;
15
- this . set ( 'fastboot.response.statusCode' , 301 ) ;
16
- } else {
17
- window . location = url ;
18
- }
8
+ this . redirector . redirectTo ( 'https://doc.rust-lang.org/cargo/getting-started/installation.html' ) ;
19
9
} ,
20
10
} ) ;
Original file line number Diff line number Diff line change
1
+ import Service , { inject as service } from '@ember/service' ;
2
+
3
+ export default Service . extend ( {
4
+ fastboot : service ( ) ,
5
+
6
+ redirectTo ( url ) {
7
+ if ( this . fastboot . isFastBoot ) {
8
+ let headers = this . fastboot . response . headers ;
9
+ headers . set ( 'location' , url ) ;
10
+ this . set ( 'fastboot.response.statusCode' , 301 ) ;
11
+ } else {
12
+ window . location = url ;
13
+ }
14
+ } ,
15
+ } ) ;
You can’t perform that action at this time.
0 commit comments