Skip to content

Commit

Permalink
解决vercel部署中,设置自定义域名后,即时通知发送失败401错误问题;需新增环境变量CUSTOM_DOMAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
kuole-o committed Jan 7, 2025
1 parent a076c93 commit 53c0ec9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/vercel/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,9 @@ async function commentSubmit (event, request) {
try {
logger.log('开始异步垃圾检测、发送评论通知')
logger.log('POST_SUBMIT')
const baseUrl = process.env.CUSTOM_DOMAIN ? `https://${process.env.CUSTOM_DOMAIN}` : `https://${request.headers.host}`
await Promise.race([
axios.post(`https://${process.env.VERCEL_URL}`, {
axios.post(baseUrl, {
event: 'POST_SUBMIT',
comment
}, { headers: { 'x-twikoo-recursion': config.ADMIN_PASS || 'true' } }),
Expand Down

0 comments on commit 53c0ec9

Please sign in to comment.