Certain characters in file names result in non-retrievable resources #25

Closed
opened 2025-12-15 15:45:00 +01:00 by antifuchs · 3 comments
Contributor

Seems I'm stumbling over weird issues today: The comic series The Wicked + The Divine (McCelvie/Wilson, 2015), represented in this folder structure has two problems with Panels, the iOS comics reader (at least with that reader, I have not tested with any other opds-capable reader at the moment):

comics/
  The Wicked + The Divine/
    The Wicked + The Divine - Once Again; 1-2-3-4.cbz

Problems:

  1. The folder The Wicked + The Divine can't be listed: I suspect the + character, being an HTTP meta character, gets mis-interpreted as a space character somehow.
  2. When renaming the folder to The Wicked and the Divine, the issue file itself has only pages that can't be viewed: Retrieving the pages returns a 422 and Panels shows "error" symbols on any of the page images. Again, suspect that's due to the + character in the name.

Logs

I'm relying on logs from tsnsrv, the https reverse proxy for tailscale.

  1. For the folder problem:
2025/12/14 22:42:42 INFO served original="/opds?path=The%20Wicked%20+%20The%20Divine" rewritten="http://127.0.0.1:8080/opds?path=The%20Wicked%20+%20The%20Divine" origin_login=(redact) origin_node=(redact) duration=8.614144ms http_status=200

Seems to indicate that the folder is found, but then comicopds doesn't return any content for the folder.

  1. For the single-issue problem:
2025/12/14 22:48:27 INFO served original="/pse/page?path=The%20Wicked%20and%20The%20Divine/The%20Wicked%20+%20The%20Divine%20-%20Once%20Again;%201-2-3-4.cbz&page=0" rewritten="http://127.0.0.1:8080/pse/page?page=0" origin_login=(redact) origin_node=(redact) duration=4.775286ms http_status=422
Seems I'm stumbling over weird issues today: The comic series `The Wicked + The Divine` (McCelvie/Wilson, 2015), represented in this folder structure has two problems with Panels, the iOS comics reader (at least with that reader, I have not tested with any other opds-capable reader at the moment): ``` comics/ The Wicked + The Divine/ The Wicked + The Divine - Once Again; 1-2-3-4.cbz ``` Problems: 1. The folder `The Wicked + The Divine` can't be listed: I suspect the `+` character, being an HTTP meta character, gets mis-interpreted as a space character somehow. 2. When renaming the folder to `The Wicked and the Divine`, the issue file itself has only pages that can't be viewed: Retrieving the pages returns a 422 and Panels shows "error" symbols on any of the page images. Again, suspect that's due to the `+` character in the name. ## Logs I'm relying on logs from `tsnsrv`, the https reverse proxy for tailscale. 1. For the folder problem: ```console 2025/12/14 22:42:42 INFO served original="/opds?path=The%20Wicked%20+%20The%20Divine" rewritten="http://127.0.0.1:8080/opds?path=The%20Wicked%20+%20The%20Divine" origin_login=(redact) origin_node=(redact) duration=8.614144ms http_status=200 ``` Seems to indicate that the folder is found, but then comicopds doesn't return any content for the folder. 2. For the single-issue problem: ```console 2025/12/14 22:48:27 INFO served original="/pse/page?path=The%20Wicked%20and%20The%20Divine/The%20Wicked%20+%20The%20Divine%20-%20Once%20Again;%201-2-3-4.cbz&page=0" rewritten="http://127.0.0.1:8080/pse/page?page=0" origin_login=(redact) origin_node=(redact) duration=4.775286ms http_status=422 ```
Author
Contributor

Update, the second problem at least looks like a Panels bug; the link generated by ComicOPDS looks like this:

    <!-- OPDS Page Streaming Extension 1.2 -->
    <link rel="http://vaemendis.net/opds-pse/stream"
          type="image/jpeg"
          href="https://(redact).ts.net/pse/page?path=The%20Wicked%20and%20The%20Divine/The%20Wicked%20%2B%20The%20Divine%20-%20Once%20Again%3B%201-2-3-4.cbz&amp;page={pageNumber}"
          pse:count="39" />

Here, it looks like both the + and the ; characters are the problem (and other file names have issues with the ' character, too): Replacing just the + with "and" still results in broken page images, you also have to replace the ; character with something else.

Update, the second problem at least looks like a Panels bug; the link generated by ComicOPDS looks like this: ```xml <!-- OPDS Page Streaming Extension 1.2 --> <link rel="http://vaemendis.net/opds-pse/stream" type="image/jpeg" href="https://(redact).ts.net/pse/page?path=The%20Wicked%20and%20The%20Divine/The%20Wicked%20%2B%20The%20Divine%20-%20Once%20Again%3B%201-2-3-4.cbz&amp;page={pageNumber}" pse:count="39" /> ``` Here, it looks like both the + and the ; characters are the problem (and other file names have issues with the `'` character, too): Replacing just the + with "and" still results in broken page images, you also have to replace the ; character with something else.
Author
Contributor

Grump, the subsection problem seems like a Panels bug, too; here's the OPDS entry for the folder I renamed to contain a + sign:

  <entry xmlns="http://www.w3.org/2005/Atom">
  <id>https://(redact).ts.net/opds/The%20Wicked%20%2B%20The%20Divine%20-%201831</id>
  <updated>2025-12-15T15:05:37.109487+00:00</updated>
  <title>The Wicked + The Divine - 1831</title>

  
    <link rel="subsection"
          href="https://(redact).ts.net/opds?path=The%20Wicked%20%2B%20The%20Divine%20-%201831"
          type="application/atom+xml;profile=opds-catalog" />
  
</entry>

I'll report this to the Pages folks, not sure there's anything you can do here.

Grump, the subsection problem seems like a Panels bug, too; here's the OPDS entry for the folder I renamed to contain a + sign: ```xml <entry xmlns="http://www.w3.org/2005/Atom"> <id>https://(redact).ts.net/opds/The%20Wicked%20%2B%20The%20Divine%20-%201831</id> <updated>2025-12-15T15:05:37.109487+00:00</updated> <title>The Wicked + The Divine - 1831</title> <link rel="subsection" href="https://(redact).ts.net/opds?path=The%20Wicked%20%2B%20The%20Divine%20-%201831" type="application/atom+xml;profile=opds-catalog" /> </entry> ``` I'll report this to the Pages folks, not sure there's anything you can do here.
Author
Contributor

Actually, one more update: It seems like all these issues stem from + in request URLs being possibly misinterpreted. While the client should definitely try to be as conservative as possible (and not translate escape sequences to the characters they stand for), auto-translating + to is a pretty common bug in web libraries (I've definitely seen it before in Rack, the ruby webserver). Maybe this is a thing that ComicOPDS can shore up, also.

Actually, one more update: It seems like all these issues stem from `+` in request URLs being possibly misinterpreted. While the client should definitely try to be as conservative as possible (and not translate escape sequences to the characters they stand for), auto-translating `+` to ` ` is a pretty common bug in web libraries (I've definitely seen it before in Rack, the ruby webserver). Maybe this is a thing that ComicOPDS can shore up, also.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: FrederikBaerentsen/ComicOPDS#25