Skip to content

默认大小有误 #5

@1246437945

Description

@1246437945

作者描述:“默认测速大小为200MB:当未在路径中指定测速大小时,项目会默认进行200MB的测速。”
这里是有错误的,查阅代码

if (!path) {
// 路径为空,将 bytes 赋值为 100MB
bytes = 100000000;
} else if (path === "locations") {
return locations_cn(request);
} else if (path === "cdn-cgi/trace") {
// 反代 cdn-cgi/trace 请求
let targetUrl = https://speed.cloudflare.com/cdn-cgi/trace;
let cfRequest = new Request(targetUrl, request);
let response = await fetch(cfRequest);
return response;
} else {
// 其他路径,进行正常的处理
const regex = /^(\d+)([a-z]{0,2})$/i;
const match = path.match(regex);
if (!match) {
// 路径格式不正确,返回错误
return new Response("路径格式不正确", {
status: 400,
});

,其实默认大小为100MB,而非200MB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions