spec(api): 一部APIをGETに対応・認証情報をヘッダーに (MisskeyIO#837)
This commit is contained in:
parent
58513c1b81
commit
3362c464c5
11 changed files with 155 additions and 26 deletions
|
@ -32,6 +32,11 @@
|
|||
renderError('FORCED_ERROR', 'This error is forced by having forceError in local storage.')
|
||||
}
|
||||
|
||||
if (localStorage.getItem('id') === null) {
|
||||
localStorage.setItem('id', crypto.randomUUID().replaceAll('-', ''));
|
||||
}
|
||||
let id = localStorage.getItem('id');
|
||||
|
||||
//#region Detect language & fetch translations
|
||||
if (!Object.hasOwn(localStorage, 'locale')) {
|
||||
let lang = localStorage.getItem('lang');
|
||||
|
@ -40,12 +45,11 @@
|
|||
}
|
||||
|
||||
const metaRes = await window.fetch('/api/meta', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({}),
|
||||
method: 'GET',
|
||||
credentials: 'omit',
|
||||
cache: 'no-cache',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Client-Transaction-Id': `${id}-misskey-${crypto.randomUUID().replaceAll('-', '')}`
|
||||
},
|
||||
});
|
||||
if (metaRes.status !== 200) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue