Trailing slash ignored by GFile when using custom URI sheme

I’m trying to add OPDS support in Foliate. One feature is that you can open OPDS feeds from opds: links. For example, Feedbooks has such a link on their website.

The problem is that, when opening links like opds://, the trailing slash is ignored:

gjs> var file ='opds://')
gjs> file.get_uri()

Gutenberg’s site requires the trailing slash; without it, it will return “path not found”.

On the other hand, when using HTTP, the trailing slash works as expected:

gjs> var file ='')
gjs> file.get_uri()

Is this a GLib bug? Is there a way to work around this?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.