Skip to content

Commit

Permalink
Change pgn xhr
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Feb 12, 2020
1 parent 0a27277 commit ac461f0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ui/shared/round/roundXhr.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugins } from '@capacitor/core'
import { fetchJSON, fetchText } from '../../../http'
import { SESSION_ID_KEY, fetchJSON, fetchText } from '../../../http'
import { serializeQueryParameters } from '../../../utils'
import i18n from '../../../i18n'
import { OnlineGameData } from '../../../lichess/interfaces/game'
Expand All @@ -13,7 +13,14 @@ export function reload(ctrl: OnlineRoundInterface): Promise<OnlineGameData> {

export function getPGN(gameId: string, raw = false) {
const params = raw ? '?evals=0&clocks=0' : '?literate=1'
return fetchText(`/game/export/${gameId}${params}`, undefined, true)
return fetchText(`/game/export/${gameId}${params}`, {
headers: {
'Accept': 'application/x-chess-pgn, text/*',
'X-Requested-With': '__delete',
[SESSION_ID_KEY]: '__delete',
},
credentials: 'omit',
}, true)
}

export function readNote(gameId: string) {
Expand Down

0 comments on commit ac461f0

Please sign in to comment.