- getConfig: function () {
- return fetch("config.yml")
- .then((response) => {
- if (!response.ok) {
- throw Error(response.statusText);
- }
- return response.text().then((body) => {
+ getConfig: function (path = "assets/config.yml") {
+ return fetch(path).then((response) => {
+ if (response.redirected) {
+ // This allows to work with authentication proxies.
+ window.location.href = response.url;
+ return;
+ }
+ if (!response.ok) {
+ throw Error(`${response.statusText}: ${response.body}`);
+ }
+
+ const that = this;
+ return response
+ .text()
+ .then((body) => {