小说平台扩写模块测试报告

测试环境


第1轮测试:API端点发现

GET /api/v1/projects/
HTTP/1.1 401 Unauthorized
Content-Length: 34
Connection: keep-alive
Content-Type: application/json
Date: Thu, 26 Mar 2026 15:37:49 GMT
Keep-Alive: timeout=4
Proxy-Connection: keep-alive
Server: nginx/1.29.5
Www-Authenticate: Bearer
X-Request-Id: 0ba9a638-1bed-40e8-a442-3cbccd35bfaa
GET /api/v1/expansion/
HTTP/1.1 401 Unauthorized
Content-Length: 34
Connection: keep-alive
Content-Type: application/json
Date: Thu, 26 Mar 2026 15:37:50 GMT
Keep-Alive: timeout=4
Proxy-Connection: keep-alive
Server: nginx/1.29.5
Www-Authenticate: Bearer
X-Request-Id: 70aec423-827f-4b42-b729-0806d59aa2f3

第2轮测试:探索扩写API端点

问题1发现:API端点返回Method Not Allowed

{"detail":"Method Not Allowed"}
{"detail":"Not Found"}
{"detail":"Method Not Allowed"}
{"detail":"Method Not Allowed"}

第3轮测试:API端点深度探索

发现的API端点:

"/api/v1/auth/refresh"

测试认证相关端点:

POST /api/v1/auth/refresh:

{"detail":"缺少认证令牌"}

第4轮测试:认证流程测试

测试登录API:

  1. 正确格式的登录请求(form-urlencoded):
{"detail":"用户名或密码错误"}
  1. JSON格式的登录请求:
{"detail":[{"type":"missing","loc":["body","username"],"msg":"Field required","input":null},{"type":"missing","loc":["body","password"],"msg":"Field required","input":null}]}

问题2发现:登录API不支持JSON格式

第5轮测试:边界情况和错误处理

测试登录边界情况:

  1. 空用户名:
{"detail":"用户名或密码错误"}
  1. 空密码:
{"detail":"用户名或密码错误"}
  1. SQL注入测试:
{"detail":"用户名或密码错误"}
  1. XSS测试:
{"detail":"用户名或密码错误"}

问题3发现:错误信息过于笼统

第6轮测试:API路由重定向问题

测试URL尾部斜杠处理:

  1. 不带斜杠的API请求:
HTTP/1.1 307 Temporary Redirect
Connection: keep-alive
Date: Thu, 26 Mar 2026 15:38:57 GMT
Keep-Alive: timeout=4
Location: http://novel.al.jrient.cn/api/v1/projects/
Proxy-Connection: keep-alive
Server: nginx/1.29.5
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Request-Id: 57dd53d3-c681-4b12-8cc9-e6f49aac5fd8
Content-Length: 0
  1. 带斜杠的API请求:
HTTP/1.1 401 Unauthorized
Content-Length: 34
Connection: keep-alive
Content-Type: application/json
Date: Thu, 26 Mar 2026 15:38:58 GMT
Keep-Alive: timeout=4
Proxy-Connection: keep-alive
Server: nginx/1.29.5
Www-Authenticate: Bearer
X-Request-Id: 9c5fc240-1087-4736-ae5c-4c4b7e01560e

{"detail":"无效的认证凭据"}

问题4发现:API URL需要尾部斜杠

第7轮测试:探索扩写功能API

分析前端代码中的扩写相关API:

前端代码中与扩写相关的关键词:

Expand
expandRowLabel

测试可能的扩写API端点:

POST /api/v1/expansion/analyze:

{"detail":"Method Not Allowed"}

POST /api/v1/expansion/create:

{"detail":"Method Not Allowed"}

POST /api/v1/expansion/list:

{"detail":"Method Not Allowed"}

POST /api/v1/expansion/start:

{"detail":"Method Not Allowed"}

POST /api/v1/expansion/process:

{"detail":"Method Not Allowed"}

POST /api/v1/expansion/result:

{"detail":"Method Not Allowed"}

第8轮测试:HTTP方法测试

测试expansion端点的不同HTTP方法:

  1. GET /api/v1/expansion/analyze/:

  1. PUT /api/v1/expansion/:
{"detail":"Method Not Allowed"}
  1. DELETE /api/v1/expansion/:
{"detail":"Method Not Allowed"}
  1. PATCH /api/v1/expansion/:
{"detail":"Method Not Allowed"}

问题5发现:HTTP方法处理不一致

第9轮测试:响应时间测试

测试各API端点响应时间:

  1. 首页加载时间:
  1. 主JS文件加载时间:
  1. API登录端点响应时间:
  1. API projects端点响应时间:

问题6发现:主JS文件较大

第10轮测试:安全性测试

测试安全相关头信息:

  1. 响应头分析:
HTTP/1.1 200 OK
Content-Length: 1162
Accept-Ranges: bytes
Cache-Control: no-cache
Cache-Control: no-cache, no-store, must-revalidate
Connection: keep-alive
Content-Type: text/html
Date: Thu, 26 Mar 2026 15:40:02 GMT
Etag: "69c54094-48a"
Expires: Thu, 26 Mar 2026 15:40:01 GMT
Keep-Alive: timeout=4
Last-Modified: Thu, 26 Mar 2026 14:20:04 GMT
Proxy-Connection: keep-alive
Server: nginx/1.29.5
Vary: Accept-Encoding

  1. CORS测试:
HTTP/1.1 400 Bad Request
Content-Length: 22
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
Access-Control-Max-Age: 600
Connection: keep-alive
Content-Type: text/plain; charset=utf-8
Date: Thu, 26 Mar 2026 15:40:02 GMT
Keep-Alive: timeout=4
Proxy-Connection: keep-alive
Server: nginx/1.29.5
Vary: Origin
X-Request-Id: d5f99243-50ec-4653-a984-61fe59d6744d

  1. 敏感信息检查:

问题7发现:缺少部分安全响应头


测试总结

测试概览

问题汇总表

编号 问题描述 严重程度 状态
P1 扩写API端点无法直接访问(需要认证) 一般 待确认
P2 登录API不支持JSON格式 一般 待修复
P3 错误信息过于笼统 一般 待讨论
P4 API URL需要尾部斜杠 一般 待修复
P5 HTTP方法处理不一致 一般 待修复
P6 主JS文件较大(240KB) 待优化
P7 缺少部分安全响应头 一般 待添加

改进建议优先级

  1. 高优先级:修复登录API格式问题(P2),统一HTTP方法处理(P5)
  2. 中优先级:添加安全响应头(P7),统一URL路由规则(P4)
  3. 低优先级:优化JS文件大小(P6),改进错误信息(P3)

测试限制


报告生成时间:2026-03-26 23:40:19 测试人员:测试虾