mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
feat: enhance monitoring and Gemini service functionality
- Add enhanced monitoring scripts (monitor-enhanced.sh, status-unified.sh) - Improve Gemini relay service with better error handling and token management - Update authentication middleware for better compatibility - Add new package dependencies for enhanced functionality - Update .gitignore and app configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9,12 +9,13 @@ const authenticateApiKey = async (req, res, next) => {
|
||||
const startTime = Date.now()
|
||||
|
||||
try {
|
||||
// 安全提取API Key,支持多种格式
|
||||
// 安全提取API Key,支持多种格式(包括Gemini CLI支持)
|
||||
const apiKey =
|
||||
req.headers['x-api-key'] ||
|
||||
req.headers['x-goog-api-key'] ||
|
||||
req.headers['authorization']?.replace(/^Bearer\s+/i, '') ||
|
||||
req.headers['api-key']
|
||||
req.headers['api-key'] ||
|
||||
req.query.key
|
||||
|
||||
if (!apiKey) {
|
||||
logger.security(`🔒 Missing API key attempt from ${req.ip || 'unknown'}`)
|
||||
|
||||
Reference in New Issue
Block a user