lighthousebot icon indicating copy to clipboard operation
lighthousebot copied to clipboard

fix: run endpoint with output json by default

Open jepser opened this issue 6 years ago • 2 comments

https://lighthouse-ci.appspot.com/run_on_chrome it was failing if output is not provided. So now it works by set output property to json by default.

This didn't work:

curl --request POST \
  --url https://lighthouse-ci.appspot.com/run_on_chrome \
  --header 'content-type: application/json' \
  --header 'x-api-key: <key>' \
  --data '{
  "testUrl": "<test>",
  "addComment": false,
  "repo": {
    "owner": "<owner>",
    "name": "<name>"
  },
  "pr": {
    "number": "<pr>"
  }
}'

With this PR it does.

jepser avatar Nov 26 '18 15:11 jepser

This should already be taken care of here: https://github.com/ebidel/lighthouse-ci/blob/master/frontend/server.js#L172

ebidel avatar Nov 26 '18 20:11 ebidel

It's but if you send the payload without output property it breaks (as in the docs), so I decided instead of changing the docs, to add the default value.

jepser avatar Nov 26 '18 21:11 jepser