-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #1912 - kzys:fastboot-install, r=jtgeibel
Make /install work under FastBoot Will add nginx.conf change after #1907. Early feedback is welcome!
- Loading branch information
Showing
4 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default Route.extend({ | ||
redirector: service(), | ||
|
||
redirect() { | ||
window.location = 'https://doc.rust-lang.org/cargo/getting-started/installation.html'; | ||
this.redirector.redirectTo('https://doc.rust-lang.org/cargo/getting-started/installation.html'); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Service, { inject as service } from '@ember/service'; | ||
|
||
export default Service.extend({ | ||
fastboot: service(), | ||
|
||
redirectTo(url) { | ||
if (this.fastboot.isFastBoot) { | ||
let headers = this.fastboot.response.headers; | ||
headers.set('location', url); | ||
this.set('fastboot.response.statusCode', 301); | ||
} else { | ||
window.location = url; | ||
} | ||
}, | ||
}); |