Skip to content

Commit

Permalink
Uppercase HTTP method and ad user agent string
Browse files Browse the repository at this point in the history
  • Loading branch information
tobie committed Feb 3, 2024
1 parent ca04bd6 commit 3ebdb14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/fetch-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion lib/mixins/fetchable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }`
}
}
Expand Down

0 comments on commit 3ebdb14

Please sign in to comment.