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

[Bug] Cannot access a navigation feed that contains a URL encoded ":" #548

Open
mcpierce opened this issue Jul 20, 2024 · 4 comments
Open
Labels
bug Something isn't working triage Triage needed by maintainers

Comments

@mcpierce
Copy link

Describe the bug

My application is using the OPDS1Parser from v2.4.1 to read from a server. When it downloads an acquisition link like this following:

Lady+Baltimore%3A+The+Witch+Queens/volumes/2021?unread=false

it is throwing the exception:

org.readium.r2.shared.util.http.HttpException: HTTP error: MalformedRequest

The root cause (next layer down in the exception chain) is:

java.net.MalformedURLException: no protocol: Dark+Horse+Comics/series/Lady+Baltimore:+The+Witch+Queens?unread=false

I've included the OPDS page feed in the additional context below.

How to reproduce?

  1. Download an OPDS payload containing a link with a URL encoded ":" in the path.
  2. Attempted to open that link using OPDS1Parser.parseUrlString(url, httpClient)).
  3. Exception is thrown when the expected result is to load the URL.

Readium version

2.4.1

Android API version

14

Additional context

The URL (as referenced from a desktop computer) is:

http://localhost:7171/opds/collections/publishers/Dark+Horse+Comics/series/Lady+Baltimore%3A+The+Witch+Queens?unread=false

and the payload returned is:

<feed xmlns="http://www.w3.org/2005/Atom">
<title>Series: Lady Baltimore: The Witch Queens</title>
<id xmlns="">Lady+Baltimore%3A+The+Witch+Queens?unread=false</id>
<icon xmlns="">/favicon.png</icon>
<author xmlns="">
<name>ComiXed</name>
<uri>http://www.comixedproject.org/</uri>
</author>
<updated xmlns="">2024-07-20T16:53:42Z</updated>
<link xmlns="" type="application/atom+xml; profile=opds-catalog; kind=navigation" rel="start" href="root.xml"/>
<link xmlns="" type="application/opensearchdescription+xml" rel="search" href="search.xml" title="Search the library"/>
<link xmlns="" type="application/atom+xml; profile=opds-catalog; kind=navigation" rel="self" href="Lady+Baltimore%3A+The+Witch+Queens?unread=false"/>
<entry>
<title>v2021</title>
<id xmlns="">1450591362</id>
<updated xmlns="">2024-07-20T16:53:42Z</updated>
<content xmlns=""/>
<link type="application/atom+xml; profile=opds-catalog; kind=acquisition" rel="subsection" href="Lady+Baltimore%3A+The+Witch+Queens/volumes/2021?unread=false"/>
</entry>
</feed>
@mcpierce mcpierce added bug Something isn't working triage Triage needed by maintainers labels Jul 20, 2024
@qnga
Copy link
Member

qnga commented Jul 23, 2024

What is your OPDS 1 server?
I can't find any reference documentation about use of relative Urls in OPDS1 or ATOM.
@HadrienGardeur Do you have any insight on this?

@mcpierce
Copy link
Author

@qnga I was refactoring the feed to provide URLs relative to the self link based on an example catalog online and how readium behaves when consuming it.

Should my server instead returnl acquistion links that are absolute URIs rather than ones relative to the self link?

@qnga
Copy link
Member

qnga commented Jul 23, 2024

Ok, I missed the existence of the self link in OPDS 1 too. Unlike OPDS 2, it seems to allow relative self links. Relative to what? I don't know. If it's relative to the location we got the feed from, I can't see the point of a self link since we need an URL to that location anyway.

@mcpierce
Copy link
Author

@qnga So what is your recommendation for this? Is it a bug to be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Triage needed by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants