Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Service User-Agent Error - StatusCodeError: 403 - "Request forbidden by administrative rules" #213

Open
tguelcan opened this issue Nov 15, 2019 · 0 comments

Comments

@tguelcan
Copy link

StatusCodeError: 403 - "Request forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required).

https://developer.github.com/v3/#user-agent-required

Fixed in src/services/github/index.js
add:

const userRequest = (accessToken) => request({
  uri: 'https://api.github.com/user',
  json: true,
  headers: {
    'User-Agent': 'yourAppName'
  },
  qs: {
    access_token: accessToken
  }
})

and

const emailRequest = (accessToken) => request({
  uri: 'https://api.github.com/user/emails',
  json: true,
  headers: {
    'User-Agent': 'yourAppName'
  },
  qs: {
    access_token: accessToken
  }
})
@tguelcan tguelcan changed the title StatusCodeError: 403 - "Request forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required). GitHub Service User-Agent Error - StatusCodeError: 403 - "Request forbidden by administrative rules" Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant