mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-17 04:43:02 +00:00
Address code review feedback: protect types.js endpoint and improve code readability
Co-authored-by: qaiu <29825328+qaiu@users.noreply.github.com>
This commit is contained in:
@@ -311,10 +311,17 @@ public class PlaygroundApi {
|
||||
/**
|
||||
* 获取types.js文件内容
|
||||
*
|
||||
* @param ctx 路由上下文
|
||||
* @param response HTTP响应
|
||||
*/
|
||||
@RouteMapping(value = "/types.js", method = RouteMethod.GET)
|
||||
public void getTypesJs(HttpServerResponse response) {
|
||||
public void getTypesJs(RoutingContext ctx, HttpServerResponse response) {
|
||||
// 权限检查
|
||||
if (!checkAuth(ctx)) {
|
||||
ResponseUtil.fireJsonResultResponse(response, JsonResult.error("未授权访问"));
|
||||
return;
|
||||
}
|
||||
|
||||
try (InputStream inputStream = getClass().getClassLoader()
|
||||
.getResourceAsStream("custom-parsers/types.js")) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user