Commit 077ad2c
Contributor
fix: correct HTTP headers for LeetCode API authentication
The login flow was failing because the HTTP request headers sent to
LeetCode's GraphQL API were incorrect:
- 'referer' was set to 'vscode-lc-extension' instead of a valid URL
- Missing 'Origin' header required by LeetCode's CORS policy
- Missing 'User-Agent' header causing Cloudflare to block requests
- CSRF token was not being extracted from cookie and sent as X-CSRFToken
- Removed xsrfCookieName/xsrfHeaderName which only work in browser context
Fixes #4781 parent 586b3e4 commit 077ad2c
1 file changed
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
17 | 25 | | |
18 | 26 | | |
19 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
20 | 30 | | |
21 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
22 | 34 | | |
23 | 35 | | |
24 | | - | |
25 | | - | |
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
0 commit comments