Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Pre-hash query parameters are ignored, and the https: scheme is stripped

未关闭
#3 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
angularjs, javascript
领域
frontend, web-dev

调研方向

Start at the controller that reads $location.search(), constructs the fetched URL, and accesses sequences[0]; the issue does not name its file or tests. Check how AngularJS 1.4.7 parses hashbang URLs and inspect the handling of responses without sequences. Done means pre-hash query parameters work, HTTPS URLs retain their scheme, and a Canvas or Range produces a visible error instead of a blank page.

由索引模型根据 Issue 内容生成。

描述

Found while designing the resource bag for Oh My RERUM (CenterForDigitalHumanities/oh-my-rerum#10). OMR hands a resource to a tool as a percent-encoded URI in the pre-hash query string, which is the form the IIIF Content State 1.0 spec recommends. This tool cannot see it.

1. Parameters before the hash are ignored

The app reads its input through $location.search() but never enables html5Mode. In Angular 1.4.7, LocationHashbangUrl.$$parse (angular.js around line 11518) treats a URL with no fragment as empty — the comment in the source reads "Otherwise we ignore what is left".

So this works:

/read/index.html#!/read?url=https://example.org/manifest.json&p=3

and this does not:

/read/index.html?url=https://example.org/manifest.json&p=3

The second form is what any spec-conformant caller, including the IIIF Content State recommendation, produces. Enabling html5Mode, or falling back to window.location.search when $location.search() is empty, would both fix it.

2. The https: scheme is stripped from the URL being fetched

The fetched URL is built with a replace(/^https?:/, '') on the url parameter. That turns https://example.org/m.json into a protocol-relative //example.org/m.json, which inherits this page's scheme. Served over plain HTTP, every HTTPS manifest breaks. The comment or commit behind it would help — if it was a workaround for a mixed-content problem, there is a better fix.

3. A Canvas URI in url throws instead of reporting

The response is accepted if it has an @id, and then sequences[0] is read from it. A Canvas has an @id but no sequences, so the controller dies with a TypeError and the page goes blank. A Canvas or Range is a legal Content State target, so callers will send one. A visible "this is not a Manifest" message would be much more useful than a blank page.

Context

IIIF Content State 1.0, section 2.2.4, permits a bare dereferenceable URI as the value of iiif-content, and says a plain URI must not be content-state-encoded. Section 2.2.5 notes that a Canvas URI which is not itself dereferenceable needs one of the JSON forms. OMR will keep sending the plain form and surfacing the failure, rather than special-casing around this tool, so a fix here is what makes the tool reachable.

主要语言
JavaScript
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。