Pre-hash query parameters are ignored

オープン 初心者向け
#3 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
angularjs, javascript
領域
frontend

調査の方向性

urlを$location.search()経由で読み取るコードから始め、$locationProviderの設定を確認してください。issueでは、ハッシュより前のクエリが無視される理由としてAngular 1.4.7のLocationHashbangUrl.$$parseを挙げています。issueにある2つのURL形式を比較し、ハッシュより前のクエリでManifestが読み込まれることを確認してください。issueではcanvasとRangeのターゲットも別個の制限として指摘しています。それらをこの修正の一部として扱う前に、想定される範囲を確認してください。

索引モデルが 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.

url is read through $location.search(), and html5Mode is never enabled on the $locationProvider. In Angular 1.4.7, LocationHashbangUrl.$$parse (angular.js around line 11518) treats a URL with no fragment as empty — the source comment reads "Otherwise we ignore what is left".

So this works:

/aybee/index.html#!/aybee?url=https://example.org/manifest.json

and this does not:

/aybee/index.html?url=https://example.org/manifest.json

The second form is what a spec-conformant caller produces. Enabling html5Mode, or falling back to window.location.search when $location.search() comes back empty, would both fix it.

Two notes that may matter for the same change:

  • url is the only parameter the app reads. There is no way to open the viewer at a particular canvas, so a caller cannot point at a position within a Manifest.
  • The app requires a Presentation 2.x Manifest; it walks sequences[0].canvases and throws on anything else, including a Canvas or Range URI, which are legal Content State targets.

Why we are not working around it

OMR will keep emitting the conformant pre-hash form and surfacing the load failure to the visitor rather than special-casing per-tool URL shapes. A placement flag in the registration schema would mean encoding this defect into every downstream tool registry, so the fix belongs here.

主要言語
JavaScript
スター
0
フォーク
0
平均マージ
2日 21時間
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CenterForDigitalHumanities/aybee のほかの issue

CenterForDigitalHumanities/aybee の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。