ocngx / test-static-resources.sh
tanbushi's picture
Fix favicon routing: update regex pattern to match favicon.ico correctly
e504c46
Raw
History Blame
1.37 kB
#!/bin/bash
# 测试静态资源访问
echo "🔍 测试OpenCode静态资源访问..."
base_url="https://airsltd-ocngx.hf.space"
# 测试各个静态资源端点
test_resources=(
"/assets/index-OLRiU-d3.js"
"/assets/index-DViKQ2Re.css"
"/oc-theme-preload.js"
"/site.webmanifest"
"/favicon.ico"
"/favicon-96x96.png"
)
echo "📦 测试静态资源端点..."
for resource in "${test_resources[@]}"; do
echo -n " $resource: "
response=$(curl -s -w "%{http_code}" "${base_url}${resource}")
http_code="${response: -3}"
if [ "$http_code" = "200" ]; then
echo "✅ 200 OK"
elif [ "$http_code" = "404" ]; then
echo "❌ 404 Not Found"
elif [ "$http_code" = "401" ]; then
echo "❌ 401 Unauthorized"
else
echo "❓ $http_code"
fi
done
echo ""
echo "🌐 测试主页面加载..."
main_response=$(curl -s -w "%{http_code}" "${base_url}/opencode/")
main_http_code="${main_response: -3}"
if [ "$main_http_code" = "200" ]; then
echo "✅ 主页面 200 OK"
if echo "${main_response%???}" | grep -q "opencode"; then
echo "✅ 页面内容正常"
else
echo "❌ 页面内容异常"
fi
else
echo "❌ 主页面 $main_http_code"
fi
echo ""
echo "🎯 测试完成!"
echo "📱 如果所有静态资源都是200,则Web界面应该完全正常工作"