javascript: autosave with explicit cookies settings

Older browsers implemented a different default value for `window.fetch`
credentials: it was omitted unless explicitely set.

So we force the value for these older browsers:

- Firefox 39-60
- Chrome 42-67
- Safari 10.1-11.1.2

See https://github.com/github/fetch#sending-cookies
This commit is contained in:
Pierre de La Morinerie 2019-11-25 14:18:50 +01:00 committed by GitHub Action
parent 2309017727
commit 64d96646a3

View file

@ -37,6 +37,7 @@ export default class AutosaveController {
const fetchOptions = {
method: form.method,
body: formData,
credentials: 'same-origin',
headers: { Accept: 'application/json' }
};