添加表单数据恢复功能和 GitHub Token 验证 - #2
Conversation
|
不对,这AI写的啥,我还得手动改 |
There was a problem hiding this comment.
Pull request overview
This pull request adds form data persistence and GitHub token validation to handle Cloudflare bot protection challenges. When a 403 response is received (interpreted as a CF block), the implementation is designed to save form data to LocalStorage and refresh the page to pass bot detection.
Changes:
- Added GitHub token validation before API calls in the worker
- Added LocalStorage-based form data persistence and recovery in the HTML form
- Added CF block detection to trigger page refresh on 403 responses
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| worker.js | Added GitHub token validation (lines 227-254) and CF block detection logic (lines 269-282) that return 403 with nonsense data |
| _url.html | Added LocalStorage form data persistence (lines 143-168), cleanup on success (lines 230-232), and CF block detection (lines 285-292) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0826c3e to
33643d4
Compare
…s and customizing short link functionality
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
_url.html:341
- When form submission fails (either with an error response or network error), the retry state should be cleared from localStorage. Otherwise, if a user refreshes the page after a failed submission, the form will auto-submit again, potentially creating an unwanted retry loop. Add clearRetryState() calls in the error handling paths.
} else {
showError(result.error || '提交失败');
}
} catch (err) {
console.error(err);
showError(err.message || '网络错误或请求失败');
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
#1