diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-06-15 21:01:23 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-06-15 21:01:23 +0200 |
commit | a49e13a728598b3bcdce613b3854dddaeaf97457 (patch) | |
tree | e2fa290d387ca0df8ab4c5731a8d2ee810322aaf /src | |
parent | 89c25ea73ec35e8de47380b33295f6945b8334d8 (diff) |
Specify Accept header in Fetch requests.
Change-Id: I6634b9c6abc0ad7a688d4d3aa4e16349ad996cff
Diffstat (limited to 'src')
-rw-r--r-- | src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js | 4 | ||||
-rw-r--r-- | src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js b/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js index c6249ae..6ecc355 100644 --- a/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js +++ b/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js @@ -147,7 +147,7 @@ export class MlkBookmarkSubmissionForm extends HTMLElement { let searchParams = new URLSearchParams({'uri': this.uriInput.value}); console.log(`/bookmarks/page-info?${searchParams.toString()}`); let fetchUrl = new URL(`/bookmarks/page-info?${searchParams.toString()}`, document.URL); - let r = await fetch(fetchUrl); + let r = await fetch(fetchUrl, {headers: {"accept": "application/json"}}); this.uriSpinner.hidden = true; this.uriSpinner.playing = false; @@ -165,7 +165,7 @@ export class MlkBookmarkSubmissionForm extends HTMLElement { } let fetchUrl = new URL(`/posts/${this.editedId}`, document.URL); - let r = await fetch(fetchUrl); + let r = await fetch(fetchUrl, {headers: {"accept": "application/json"}}); if (!r.ok) { return; diff --git a/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js b/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js index 3dce33d..c6334ad 100644 --- a/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js +++ b/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js @@ -100,7 +100,7 @@ export class MlkLazychatSubmissionForm extends HTMLElement { } let fetchUrl = new URL(`/posts/${this.editedId}`, document.URL); - let r = await fetch(fetchUrl); + let r = await fetch(fetchUrl, {headers: {"accept": "application/json"}}); if (!r.ok) { return; |