Skip to content

Commit

Permalink
refactor: remove obsolete requestMedia option
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Apr 26, 2018
1 parent 417d3bd commit d672afe
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
5 changes: 3 additions & 2 deletions lib/defaults.js
@@ -1,7 +1,8 @@
module.exports = {
agent: undefined, // https://nodejs.org/api/https.html#https_class_https_agent
headers: {},
requestMedia: 'application/vnd.github.v3+json',
headers: {
accept: 'application/vnd.github.v3+json'
},
timeout: 0,
baseUrl: 'https://api.github.com'
}
3 changes: 1 addition & 2 deletions lib/parse-client-options.js
Expand Up @@ -9,8 +9,7 @@ const OPTION_NAMES = [
'timeout',
'baseUrl',
'agent',
'headers',
'requestMedia'
'headers'
]

function parseOptions (userOptions) {
Expand Down
1 change: 0 additions & 1 deletion scripts/templates/index.d.ts.tpl
Expand Up @@ -35,7 +35,6 @@ declare namespace Github {
baseUrl?: string;
timeout?: number;
headers?: {[header: string]: any};
requestMedia?: string;
agent?: http.Agent;

/**
Expand Down
1 change: 0 additions & 1 deletion scripts/templates/index.js.flow.tpl
Expand Up @@ -14,7 +14,6 @@ declare module "github" {
proxy?: string;
ca?: string;
headers?: {[header: Header]: any};
requestMedia?: string;
rejectUnauthorized?: boolean;
family?: number;
};
Expand Down
2 changes: 1 addition & 1 deletion test/typescript-validate.ts
Expand Up @@ -16,8 +16,8 @@ export default async function() {
// for all supported options
const octokit = new Octokit({
timeout: 0,
requestMedia: 'application/vnd.github.v3+json',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit/rest.js v1.2.3'
},
baseUrl: 'https://api.github.com',
Expand Down

0 comments on commit d672afe

Please sign in to comment.