From dbfd7ac74f47b8f31778fb933e0eebc2e7a83e95 Mon Sep 17 00:00:00 2001 From: jmtd Date: Mon, 20 Apr 2020 04:31:48 -0400 Subject: content-type for aggregate web trigger --- ..._trigger_sends_response_as_text__47__plain.mdwn | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 doc/bugs/aggregate_web_trigger_sends_response_as_text__47__plain.mdwn diff --git a/doc/bugs/aggregate_web_trigger_sends_response_as_text__47__plain.mdwn b/doc/bugs/aggregate_web_trigger_sends_response_as_text__47__plain.mdwn new file mode 100644 index 000000000..733579ffa --- /dev/null +++ b/doc/bugs/aggregate_web_trigger_sends_response_as_text__47__plain.mdwn @@ -0,0 +1,40 @@ +With IkiWiki 3.20200202.3, [[plugins/aggregate]]'s web trigger sends it's response as HTTP 200, Content-Type: text/plain, followed by a payload that seems to include a Content-type in the body accidentally, and a bunch of HTML: + + + qusp▶ GET -e "https://$redacted/ikiwiki?do=aggregate_webtrigger" + Enter username for Git Access at REDACTED:443: admin + Password: + 200 OK + Connection: close + Date: Mon, 20 Apr 2020 08:27:39 GMT + Server: nginx/1.14.2 + Content-Length: 2467 + Content-Type: text/plain + Client-Date: Mon, 20 Apr 2020 08:27:39 GMT + Client-Peer: 31.51.75.214:443 + Client-Response-Num: 1 + Client-SSL-Cert-Issuer: /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3 + Client-SSL-Cert-Subject: /CN=REDACTED + Client-SSL-Cipher: ECDHE-RSA-CHACHA20-POLY1305 + Client-SSL-Socket-Class: IO::Socket::SSL + + Aggregation triggered via web. + + Content-type: text/html + + + + + … + +Looking at the source it's fairly clear why: + + +I guess it was never intended for a human to see this output. I've found it useful to add a link button to some private pages to manually trigger the web hook, +something like + + webtrigger + +So it would be nice if the payload was sent with a HTML content-type (which wouldn't hurt cron jobs or clients that ignore the body anyway) + +*— [[Jon]], 2020-04-20* -- cgit v1.2.3