CdnPreconnect misses `href="https://cdn.shopify.com"` without a trailing path
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- testing-qa
调研方向
找到 CdnPreconnect 检查及其测试,然后查看它如何匹配 href 值,以及如何断言预期的违规情况。添加裸 CDN 主机和协议相对 URL 的用例,再添加不应匹配的 example.com 路径用例;运行针对该检查的测试。完成标准是前两个标签会被报告,第三个不会。
由索引模型根据 Issue 内容生成。
描述
CdnPreconnect matches the href with the pattern .+cdn.shopify.com.+, wrapped in whitespace anchors. The pattern requires at least one character after cdn.shopify.com, so the most common form of the tag is never reported:
<link rel="preconnect" href="https://cdn.shopify.com" crossorigin>
<link rel="preconnect" href="//cdn.shopify.com">
Because the dots are unescaped and the host is not anchored, the pattern also reports links to other hosts that only contain the text in their path:
<link rel="preconnect" href="https://example.com/cdn.shopify.com.html">
The Ruby theme-check version of this check reported any href that contains cdn.shopify.com, so the first case is a regression from the port.
Expected behavior
The first two tags are reported. The third tag is not reported.
Actual behavior
The first two tags produce no offense. The third tag is reported.
Steps to reproduce
- Add
<link rel="preconnect" href="https://cdn.shopify.com" crossorigin>tolayout/theme.liquid. - Run
shopify theme check. - No
CdnPreconnectoffense appears. Changing thehreftohttps://cdn.shopify.com/reports the offense.
- 主要语言
- TypeScript
- 星标
- 240
- 派生
- 106
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 23
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Shopify/theme-tools 的其他 Issue
-
theme-graph CLI never calls getWebComponentMap, so custom-element references are never resolved可能已有人在做 @reginaldalfret 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
Shopify/theme-tools#1291 · 1 条评论 ·
维护者通常 1 天内回复
-
JSONMissingBlock false positive for app block when section supports both @app and @theme可能已有人在做 @chippleh1392 于 144 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
Shopify/theme-tools#1144 · 2 条评论 · 8 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
Shopify/theme-tools#1367 ·
维护者通常 1 天内回复
-
HardcodedRoutes flags paths that only share a prefix with a route可能已有人在做 @RaphaelFakhri 于 10 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 20/100
Shopify/theme-tools#1362 ·
维护者通常 1 天内回复
-
HTML close-tag auto-insertion (`onTypeFormatting` on `>`) closes the wrong element可能已有人在做 @efegokdemir 于 24 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 38/100
Shopify/theme-tools#1327 ·
维护者通常 1 天内回复
查看 Shopify/theme-tools 的全部 Issue
相似的 Issue
-
area:cli bug P4
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug from-studio
难度 2/5 1-3 小时 新手友好度 65/100
esengine/DeepSeek-Reasonix#14868 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
linxiv-dev/linXiv#384 · 1 条评论 ·
维护者通常 1 天内回复
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复