Skip to content

Incorrect implementation of file:// protocol for datasources #57

Open
@joachimvh

Description

@joachimvh

Currently, when setting up a datasource using the file:// protocol, the 'file:' part of the link gets stripped and the remainder gets used to find the file ( https://github.com/LinkedDataFragments/Server.js/blob/master/lib/datasources/Datasource.js#L148 )

The first two slashes should also be stripped, and besides that there are some additional considerations ( https://en.wikipedia.org/wiki/File_URI_scheme ). And yes, one of the issues is that it's different between UNIX and Windows 😛

Now we could also just not do that and use our 'own' file protocol (file:URI as it is now). The reason for this issue is one specific test that uses the file:// protocol: https://github.com/LinkedDataFragments/Server.js/blob/master/test/datasources/Datasource-test.js#L63
This test fails on Windows because the extracted path becomes //C:/my/path. On unix the extracted path is ///my/path which is not a problem for the path parser.

So either that test has to change or the interpretation of the file:// protocol

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions