Fix "Missing or invalid csrf_token parameter" on export for OR 3.5+

This commit is contained in:
Tobias Zeumer 2024-12-07 16:46:35 +01:00
parent eb61b6a1c4
commit f27025233c
1 changed files with 2 additions and 1 deletions

3
orcli
View File

@ -1636,6 +1636,7 @@ function log() {
# post to export-rows endpoint
# shellcheck shell=bash disable=SC2154
function post_export() {
csrf="$(get_csrf)"
local curloptions
for d in "$@"; do
curloptions+=("--data-urlencode")
@ -1657,7 +1658,7 @@ function post_export() {
curloptions+=("--output" "${args[--output]}")
fi
# post
if ! curl -fs "${curloptions[@]}" "${OPENREFINE_URL}/command/core/export-rows"; then
if ! curl -fs "${curloptions[@]}" "${OPENREFINE_URL}/command/core/export-rows${csrf}"; then
error "exporting ${args[project]} failed!"
else
if [[ ${args[--output]} ]]; then