Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(pub.Publication).Get when href contains anchors #83

Open
atomotic opened this issue Sep 28, 2023 · 1 comment
Open

(pub.Publication).Get when href contains anchors #83

atomotic opened this issue Sep 28, 2023 · 1 comment
Assignees

Comments

@atomotic
Copy link

Calling Get when a manifest.Link Href contains anchors returns resource: error 404: file does not exist

an example Manifest.TableOfContents

     manifest.Link{
        Href:       "/OEBPS/Text/appendice1.xhtml",
        Type:       "",
        Templated:  false,
        Title:      "APPENDICE A ANNALI DEI RE E DEI GOVERNATORI",
        Rels:       manifest.Strings{},
        Properties: manifest.Properties{},
        Height:     0x0,
        Width:      0x0,
        Bitrate:    0.000000,
        Duration:   0.000000,
        Languages:  manifest.Strings{},
        Alternates: manifest.LinkList{},
        Children:   manifest.LinkList{
          manifest.Link{
            Href:       "/OEBPS/Text/appendice1.xhtml#sec1",
            Type:       "",
            Templated:  false,
            Title:      "I. I re Númenóreani",
            Rels:       manifest.Strings{},
            Properties: manifest.Properties{},
            Height:     0x0,
            Width:      0x0,
            Bitrate:    0.000000,
            Duration:   0.000000,
            Languages:  manifest.Strings{},
            Alternates: manifest.LinkList{},
            Children:   manifest.LinkList{},
          },
          manifest.Link{
            Href:       "/OEBPS/Text/appendice1.xhtml#sec2",
            Type:       "",
            Templated:  false,
            Title:      "II. La casa di Eorl",
            Rels:       manifest.Strings{},
            Properties: manifest.Properties{},
            Height:     0x0,
            Width:      0x0,
            Bitrate:    0.000000,
            Duration:   0.000000,
            Languages:  manifest.Strings{},
            Alternates: manifest.LinkList{},
            Children:   manifest.LinkList{},
          },

A check on anchors could be added to Get?

@mickael-menu
Copy link
Member

In the mobile toolkits, we are dropping both fragments and query parameters from the href as a fallback, in Publication.get():

https://github.com/readium/kotlin-toolkit/blob/482ab0c2d759b4484762b0b823a953cc66661259/readium/shared/src/main/java/org/readium/r2/shared/publication/Publication.kt#L206-L210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants