diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-08-08 08:35:32 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-08-08 08:35:32 -0700 |
| commit | 297e48661d5df5d0d6d306b5bd5844301cbc093a (patch) | |
| tree | b404bb11f0a5a2402521e90fcd7dfa996999e070 | |
| parent | 4e003e9cdbe8694f87fddbd82c68f1414057161e (diff) | |
server: Accept POST instead of GET at babelmark endpoint.
| -rw-r--r-- | server/PandocServer.hs | 2 | ||||
| -rw-r--r-- | trypandoc/index.html | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/server/PandocServer.hs b/server/PandocServer.hs index 5b02c4ea3..4dde68efb 100644 --- a/server/PandocServer.hs +++ b/server/PandocServer.hs @@ -45,7 +45,7 @@ type API = :<|> ReqBody '[JSON] [Params] :> Post '[JSON] [Text] :<|> - "babelmark" :> ReqBody '[JSON] Params :> Get '[JSON] Value + "babelmark" :> ReqBody '[JSON] Params :> Post '[JSON] Value :<|> "version" :> Get '[PlainText, JSON] Text diff --git a/trypandoc/index.html b/trypandoc/index.html index 846b51515..fd4664778 100644 --- a/trypandoc/index.html +++ b/trypandoc/index.html @@ -159,7 +159,7 @@ function newpage() { let standalone = params.get("standalone") === "true"; document.getElementById("standalone").checked = standalone; if (text && text != "") { - fetch("/cgi-bin/pandoc-cgi/version") + fetch("/cgi-bin/pandoc-server.cgi/version") .then(response => response.text()) .then(restext => document.getElementById("version").textContent = restext @@ -167,7 +167,7 @@ function newpage() { let params = { from: from, to: to, text: text, standalone: standalone }; // console.log(JSON.stringify(params)); - fetch("/cgi-bin/pandoc-cgi", { + fetch("/cgi-bin/pandoc-server.cgi", { method: "POST", headers: {"Content-Type": "application/json"}, body: JSON.stringify(params) @@ -182,8 +182,9 @@ function newpage() { }); }; document.getElementById("convert").onclick = newpage; - document.getElementById("from").onclick = newpage; - document.getElementById("to").onclick = newpage; + document.getElementById("from").onchange = newpage; + document.getElementById("to").onchange = newpage; + document.getElementById("standalone").onchange = newpage; })(); </script> |
