diff --git a/lib/fetch-url.js b/lib/fetch-url.js index d205678..7b3c771 100644 --- a/lib/fetch-url.js +++ b/lib/fetch-url.js @@ -5,6 +5,10 @@ const request = require("request"); module.exports = (url, service) => { return new Promise((resolve, reject) => { + if (typeof url == "string") { + url = { url }; + } + url.headers = { "User-Agent": "pr-preview" }; request(url, function (error, response, body) { if (error) { error.data = { request_url: url, service: service }; diff --git a/lib/mixins/fetchable.js b/lib/mixins/fetchable.js index c981964..f08cd65 100644 --- a/lib/mixins/fetchable.js +++ b/lib/mixins/fetchable.js @@ -42,7 +42,7 @@ module.exports = (superclass) => class extends superclass { getBikeshedUrl(data) { let query = this.getQuery(data, "&", true); return { - method: "post", + method: "POST", url: `https://api.csswg.org/bikeshed/?url=${ urlencode(this.github_url) }${ query }` } }