Skip to content

[ERROR] http error [400] #100

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

Closed
cczhong11 opened this issue May 26, 2018 · 9 comments · Fixed by #101
Closed

[ERROR] http error [400] #100

cczhong11 opened this issue May 26, 2018 · 9 comments · Fixed by #101

Comments

@cczhong11
Copy link

I could use leetcode-cli properly half hours ago. But now it only shows [ERROR] http error [400] with only leetcode show 1. I ensured my network is okay and I have login in my account. I am in US, no GFW problem. If this was just temporary problem, I will close this issue.

@jarronshih
Copy link

jarronshih commented May 26, 2018

+1 for the same issue. I could use it yesterday.

[DEBUG] running leetcode.getProblem
[TRACE] REQUEST %s { url: 'https://leetcode.com/graphql',
  headers:
   { Cookie: <hidden>,
     'X-CSRFToken': <hidden>,
     'X-Requested-With': 'XMLHttpRequest',
     Origin: 'https://leetcode.com',
     Referer: 'https://leetcode.com/problems/longest-palindromic-subsequence/description/' },
  json: true,
  body:
   { query: 'query getQuestionDetail($titleSlug: String!) {\n  question(titleSlug: $titleSlug) {\n    content\n    stats\n    codeDefinition\n    sampleTestCase\n    enableRunCode\n    metaData\n    translatedContent\n    discussCategoryId\n  }\n}',
     variables: { titleSlug: 'longest-palindromic-subsequence' },
     operationName: 'getQuestionDetail' },
  callback: [Function],
  method: 'POST' }
[TRACE] REQUEST %s make request https://leetcode.com/graphql
[TRACE] REQUEST %s onRequestResponse https://leetcode.com/graphql 400 { date: 'Sat, 26 May 2018 01:24:26 GMT',
  'content-type': 'application/json',
  'content-length': '130',
  connection: 'close',
  'set-cookie':
   [ '__cfduid=xxxx; expires=Sun, 26-May-19 01:24:26 GMT; path=/; domain=.leetcode.com; HttpOnly',
     'csrftoken=xxxx; expires=Sat, 25-May-2019 01:24:26 GMT; Max-Age=31449600; Path=/; Secure' ],
  vary: 'Cookie',
  'x-frame-options': 'SAMEORIGIN',
  'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
  'x-content-type-options': 'nosniff',
  'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
  server: 'cloudflare',
  'cf-ray': 'xxx' }
[TRACE] REQUEST %s reading response's body
[TRACE] REQUEST %s finish init function https://leetcode.com/graphql
[TRACE] REQUEST %s response end https://leetcode.com/graphql 400 { date: 'Sat, 26 May 2018 01:24:26 GMT',
  'content-type': 'application/json',
  'content-length': '130',
  connection: 'close',
  'set-cookie':
   [ '__cfduid=xxx; expires=Sun, 26-May-19 01:24:26 GMT; path=/; domain=.leetcode.com; HttpOnly',
     'csrftoken=xxx; expires=Sat, 25-May-2019 01:24:26 GMT; Max-Age=31449600; Path=/; Secure' ],
  vary: 'Cookie',
  'x-frame-options': 'SAMEORIGIN',
  'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
  'x-content-type-options': 'nosniff',
  'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
  server: 'cloudflare',
  'cf-ray': 'xxx' }
[TRACE] REQUEST %s end event https://leetcode.com/graphql
[TRACE] REQUEST %s has body https://leetcode.com/graphql 130
[TRACE] REQUEST %s emitting complete https://leetcode.com/graphql
[DEBUG] http error: 400
[ERROR] http error [400]

Maybe there's spec change on leetcode graphql API?

@anooprh
Copy link

anooprh commented May 26, 2018

+1 on the exact same issue !!

@caoyuan0816
Copy link

Same Issue, I'm in China right now. I can submit and test solutions but cannot use show command to download and generate question. It always show http error [400].

@si-yao
Copy link
Contributor

si-yao commented May 26, 2018

+1 for US user.

@jdneo
Copy link
Contributor

jdneo commented May 28, 2018

@skygragon May I ask what is the ETA for the new release with this fix?

@skygragon
Copy link
Owner

@guys, please tryout this latest fix and let me know if the issue is gone for you.

@cczhong11
Copy link
Author

It works for me.

@skygragon
Copy link
Owner

@jdneo please try the latest release

npm install -g leetcode-cli

@jdneo
Copy link
Contributor

jdneo commented May 29, 2018

@skygragon The 2.5.2 works perfectly fine! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants