We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a1542c commit fac7766Copy full SHA for fac7766
app/routes/install.js
@@ -1,7 +1,20 @@
1
import Route from '@ember/routing/route';
2
+import { inject as service } from '@ember/service';
3
4
export default Route.extend({
5
+ fastboot: service(),
6
+
7
redirect() {
- window.location = 'https://doc.rust-lang.org/cargo/getting-started/installation.html';
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
+ }
19
},
20
});
0 commit comments