Fixed basic authentication for search index retrieval

This commit is contained in:
squidfunk
2017-01-06 18:19:15 +01:00
parent 33c183754c
commit b273c429d9
5 changed files with 11 additions and 10 deletions

View File

@@ -141,8 +141,9 @@ export default class Application {
new Material.Event.Listener(document.forms.search.query, [
"focus", "keyup"
], new Material.Search.Result("[data-md-component=result]", () => {
return fetch(`${this.config_.url.base}/mkdocs/search_index.json`)
.then(response => response.json())
return fetch(`${this.config_.url.base}/mkdocs/search_index.json`, {
credentials: "same-origin"
}).then(response => response.json())
.then(data => {
return data.docs.map(doc => {
doc.location = this.config_.url.base + doc.location